window.vc_prettyPhoto=function(){};
jQuery(document).ready(function(){
"use strict";
MOUNTHOOD_STORAGE['theme_init_counter']=0;
mounthood_init_actions();
if(jQuery(window).width() > 767){
setTimeout(function(){
setEqualHeight(jQuery(".footer_wrap .footer_wrap_inner .columns_wrap > .widget"));
}, 600);
};});
jQuery(window).on('beforeunload', function(){
"use strict";
if(jQuery.browser&&!jQuery.browser.safari) jQuery('#page_preloader').css({display: 'block', opacity: 0}).animate({opacity:0.8}, 300);
});
function setEqualHeight(columns){
var tallestcolumn=0;
columns.each(function(){
currentHeight=jQuery(this).height();
if(currentHeight > tallestcolumn){
tallestcolumn=currentHeight;
}}
);
columns.height(tallestcolumn);
}
function mounthood_init_actions(){
"use strict";
if(MOUNTHOOD_STORAGE['vc_edit_mode']&&jQuery('.vc_empty-placeholder').length==0&&MOUNTHOOD_STORAGE['theme_init_counter']++ < 30){
setTimeout(mounthood_init_actions, 200);
return;
}
jQuery('#page_preloader').animate({opacity:0}, 500, function(){ jQuery(this).css({display: 'none'});});
if(mounthood_is_retina()){
mounthood_set_cookie('mounthood_retina', 1, 365);
}
mounthood_ready_actions();
setTimeout(function(){
jQuery(window).on('resize.mounthood', function(){
mounthood_resize_actions();
mounthood_scroll_actions()
}).trigger('resize.mounthood');
}, 10);
jQuery(document).on('vc-full-width-row', function(){
mounthood_resize_actions();
mounthood_scroll_actions()
});
jQuery(window).on('scroll.mounthood', function(){
"use strict";
mounthood_scroll_actions();
});
}
function mounthood_ready_actions(){
"use strict";
if(window.mounthood_theme_ready_actions) mounthood_theme_ready_actions();
jQuery('.widget ul > li').each(function(){
if(jQuery(this).find('ul').length > 0){
jQuery(this).addClass('has_children');
}});
jQuery('.widget_archive a').each(function(){
var val=jQuery(this).html().split(' ');
if(val.length > 1){
val[val.length-1]='' + val[val.length-1] + '';
jQuery(this).html(val.join(' '))
}});
jQuery('.widget_subcategories').on('change', 'select', function(){
var dropdown=jQuery(this).get(0);
if(dropdown.options[dropdown.selectedIndex].value > 0){
location.href=MOUNTHOOD_STORAGE['site_url'] + "/?cat="+dropdown.options[dropdown.selectedIndex].value;
}});
jQuery('.widget_calendar').on('click', '.month_prev a, .month_next a', function(e){
"use strict";
var calendar=jQuery(this).parents('.wp-calendar');
var m=jQuery(this).data('month');
var y=jQuery(this).data('year');
var l=jQuery(this).data('letter');
var pt=jQuery(this).data('type');
jQuery.post(MOUNTHOOD_STORAGE['ajax_url'], {
action: 'calendar_change_month',
nonce: MOUNTHOOD_STORAGE['ajax_nonce'],
letter: l,
month: m,
year: y,
post_type: pt
}).done(function(response){
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: MOUNTHOOD_STORAGE['ajax_error'] };
console.log(response);
}
if(rez.error===''){
calendar.parent().fadeOut(200, function(){
jQuery(this).find('.wp-calendar').remove();
jQuery(this).append(rez.data).fadeIn(200);
});
}});
e.preventDefault();
return false;
});
jQuery('.video_bg').each(function(){
var youtube=jQuery(this).data('youtube-code');
if(youtube){
jQuery(this).tubular({videoId: youtube});
}});
jQuery('.slider_over_button,.slider_over_close').on('click', function(e){
jQuery(this).parent().toggleClass('opened');
e.preventDefault();
return false;
});
if(jQuery('ul#menu_side').length > 0){
jQuery('ul#menu_side').clone().removeAttr('id').removeClass('menu_side_nav').addClass('menu_side_responsive').insertAfter('ul#menu_side');
mounthood_show_current_menu_item(jQuery('.menu_side_responsive'), jQuery('.sidebar_outer_menu_responsive_button'));
}
if(jQuery('.header_mobile').length > 0){
jQuery('.header_mobile .menu_main_nav_area ul#menu_main').removeAttr('id');
jQuery('.header_mobile .menu_button').on('click', function(){
jQuery('.header_mobile .side_wrap').toggleClass('open');
jQuery('.header_mobile .mask').toggleClass('show');
jQuery('html').toggleClass('menu_mobile_open');
if(mounthood_browser_is_ios()&&jQuery('body').hasClass('menu_mobile')){
jQuery('body').toggleClass('ios_fixed');
}});
jQuery('.header_mobile .mask, .header_mobile .side_wrap .close').on('click', function(){
jQuery('.header_mobile .side_wrap').removeClass('open');
jQuery('.header_mobile .mask').removeClass('show');
jQuery('html').removeClass('menu_mobile_open');
if(mounthood_browser_is_ios()&&jQuery('body').hasClass('menu_mobile')){
jQuery('body').removeClass('ios_fixed');
}});
}
jQuery('.menu_pushy_button').on('click', function(e){
"use strict";
jQuery('body').addClass('pushy-active').css('overflow', 'hidden');
jQuery('.site-overlay').fadeIn('fast');
e.preventDefault();
return false;
});
jQuery('.pushy .close-pushy,.site-overlay').on('click', function(e){
jQuery('body').removeClass('pushy-active').css('overflow', 'visible');
jQuery('.site-overlay').fadeOut('fast');
e.preventDefault();
return false;
});
jQuery('.sidebar_outer_widgets_button').on('click', function(e){
"use strict";
jQuery('.sidebar_outer_widgets').slideToggle();
e.preventDefault();
return false;
});
jQuery('.header_mobile .menu_main_nav .menu-item-has-children > a, .menu_side_responsive .menu-item-has-children > a, .menu_pushy_nav_area .menu-item-has-children > a, body:not(.woocommerce) .widget_area:not(.footer_wrap) .widget_product_categories ul.product-categories .has_children > a').prepend('');
jQuery('.header_mobile .menu_main_nav, .menu_side_responsive, .menu_pushy_nav_area, body:not(.woocommerce) .widget_area:not(.footer_wrap) .widget_product_categories').on('click', 'li a,li a .open_child_menu, ul.product-categories.plain li a .open_child_menu', function(e){
"use strict";
var is_menu_main=jQuery(this).parents('.menu_main_nav').length > 0;
var $a=jQuery(this).hasClass('open_child_menu') ? jQuery(this).parent():jQuery(this);
if((!is_menu_main||jQuery('body').hasClass('menu_mobile'))&&($a.parent().hasClass('menu-item-has-children')||$a.parent().hasClass('has_children'))){
if($a.siblings('ul:visible').length > 0)
$a.siblings('ul').slideUp().parent().removeClass('opened');
else {
jQuery(this).parents('li').siblings('li').find('ul:visible').slideUp().parent().removeClass('opened');
$a.siblings('ul').slideDown().parent().addClass('opened');
}}
if(jQuery(this).hasClass('open_child_menu')||$a.attr('href')=='#'){
e.preventDefault();
return false;
}});
mounthood_init_sfmenu('.menu_main_nav_area ul#menu_main, ul#menu_user, ul#menu_side, body:not(.woocommerce) .widget_area:not(.footer_wrap) .widget_product_categories ul.product-categories');
if(MOUNTHOOD_STORAGE['menu_hover']=='slide_line'||MOUNTHOOD_STORAGE['menu_hover']=='slide_box'){
setTimeout(function(){
"use strict";
jQuery('#menu_main').spasticNav({
style: MOUNTHOOD_STORAGE['menu_hover']=='slide_line' ? 'line':'box',
color: MOUNTHOOD_STORAGE['accent1_hover'],
colorOverride: false
});
}, 500);
}
if(MOUNTHOOD_STORAGE['toc_menu']!='hide'&&MOUNTHOOD_STORAGE['toc_menu']!='no'){
mounthood_build_page_toc();
}
jQuery('#toc, ul#menu_main li, ul#menu_user li, ul#menu_side li, ul#menu_footer li, ul#menu_pushy li').on('click', 'a', function(e){
"use strict";
var href=jQuery(this).attr('href');
if(href===undefined) return;
var pos=href.indexOf('#');
if(pos < 0||href.length==1) return;
if(jQuery(href.substr(pos)).length > 0){
var loc=window.location.href;
var pos2=loc.indexOf('#');
if(pos2 > 0) loc=loc.substring(0, pos2);
var now=pos==0;
if(!now) now=loc==href.substring(0, pos);
if(now){
mounthood_document_animate_to(href.substr(pos));
mounthood_document_set_location(pos==0 ? loc + href:href);
e.preventDefault();
return false;
}}
});
MOUNTHOOD_STORAGE['top_panel_height']=0; //Math.max(0, jQuery('.top_panel_wrap').height());
MOUNTHOOD_STORAGE['side_panel_height']=0;
jQuery('.pager_cur').on('click', function(e){
"use strict";
jQuery('.pager_slider').slideDown(300, function(){
mounthood_sc_init(jQuery('.pager_slider').eq(0));
});
e.preventDefault();
return false;
});
jQuery('#viewmore_link').on('click', function(e){
"use strict";
if(!MOUNTHOOD_STORAGE['viewmore_busy']&&!jQuery(this).hasClass('viewmore_empty')){
jQuery(this).parent().addClass('loading');
MOUNTHOOD_STORAGE['viewmore_busy']=true;
jQuery.post(MOUNTHOOD_STORAGE['ajax_url'], {
action: 'view_more_posts',
nonce: MOUNTHOOD_STORAGE['ajax_nonce'],
page: MOUNTHOOD_STORAGE['viewmore_page']+1,
data: MOUNTHOOD_STORAGE['viewmore_data'],
vars: MOUNTHOOD_STORAGE['viewmore_vars']
}).done(function(response){
"use strict";
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: MOUNTHOOD_STORAGE['ajax_error'] };
console.log(response);
}
jQuery('#viewmore_link').parent().removeClass('loading');
MOUNTHOOD_STORAGE['viewmore_busy']=false;
if(rez.error===''){
var posts_container=jQuery('.content').eq(0);
if(posts_container.find('.isotope_wrap').length > 0) posts_container=posts_container.find('.isotope_wrap').eq(0);
if(posts_container.hasClass('isotope_wrap')){
posts_container.data('last-width', 0).append(rez.data);
MOUNTHOOD_STORAGE['isotope_init_counter']=0;
mounthood_init_appended_isotope(posts_container, rez.filters);
} else
jQuery('#viewmore').before(rez.data);
MOUNTHOOD_STORAGE['viewmore_page']++;
if(rez.no_more_data==1){
jQuery('#viewmore_link').addClass('viewmore_empty').parent().hide();
}
mounthood_init_post_formats();
mounthood_sc_init(posts_container);
mounthood_scroll_actions();
}});
}
e.preventDefault();
return false;
});
jQuery('.woocommerce,.woocommerce-page').on('click', '.mode_buttons a', function(e){
"use strict";
var mode=jQuery(this).hasClass('woocommerce_thumbs') ? 'thumbs':'list';
mounthood_set_cookie('mounthood_shop_mode', mode, 365);
jQuery(this).siblings('input').val(mode).parents('form').get(0).submit();
e.preventDefault();
return false;
});
jQuery('body').bind('added_to_cart', function(){
"use strict";
var total=jQuery('.widget_shopping_cart').eq(0).find('.total .amount').text();
if(total!=undefined){
jQuery('.top_panel_cart_button .cart_summa').text(total);
}
var cnt=0;
jQuery('.widget_shopping_cart_content').eq(0).find('.cart_list li').each(function(){
var q=jQuery(this).find('.quantity').html().split(' ', 2);
if(!isNaN(q[0]))
cnt +=Number(q[0]);
});
var items=jQuery('.top_panel_cart_button .cart_items').eq(0).text().split(' ', 2);
items[0]=cnt;
jQuery('.top_panel_cart_button .cart_items').text(items[0]+' '+items[1]);
jQuery('.top_panel_cart_button').data({
'items': cnt ? cnt:0,
'summa': total ? total:0
});
});
jQuery('.top_panel_middle .top_panel_cart_button, .header_mobile .top_panel_cart_button').on('click', function(e){
"use strict";
jQuery(this).siblings('.sidebar_cart').slideToggle();
e.preventDefault();
return false;
});
jQuery('.woocommerce div.quantity,.woocommerce-page div.quantity').append('');
jQuery('.woocommerce div.quantity').on('click', '>span', function(e){
"use strict";
var f=jQuery(this).siblings('input');
if(jQuery(this).hasClass('q_inc')){
f.val(Math.max(0, parseInt(f.val()))+1);
}else{
f.val(Math.max(1, Math.max(0, parseInt(f.val()))-1));
}
e.preventDefault();
return false;
});
jQuery('.popup_link,.popup_login_link,.popup_register_link').addClass('inited').on('click', function(e){
var popup=jQuery(jQuery(this).attr('href'));
if(popup.length===1){
mounthood_hide_popup(jQuery(popup.hasClass('popup_login') ? '.popup_registration':'.popup_login'));
mounthood_show_popup(popup);
}
e.preventDefault();
return false;
});
jQuery('.popup_wrap').on('click', '.popup_close', function(e){
var popup=jQuery(this).parent();
if(popup.length===1){
mounthood_hide_popup(popup);
}
e.preventDefault();
return false;
});
jQuery('.bookmarks_add').on('click', function(e){
"use strict";
var title=window.document.title.split('|')[0];
var url=window.location.href;
var list=mounthood_get_cookie('mounthood_bookmarks');
var exists=false;
if(list){
try {
list=JSON.parse(list);
} catch (e){}
if(list.length){
for (var i=0; i'+MOUNTHOOD_STORAGE['strings']['bookmark_title']+'
', MOUNTHOOD_STORAGE['strings']['bookmark_add'], null,
function(btn, popup){
"use strict";
if(btn!=1) return;
title=message_popup.find('#bookmark_title').val();
list.push({title: title, url: url});
jQuery('.bookmarks_list').append(''+title+'');
mounthood_set_cookie('mounthood_bookmarks', JSON.stringify(list), 365);
setTimeout(function (){mounthood_message_success(MOUNTHOOD_STORAGE['strings']['bookmark_added'], MOUNTHOOD_STORAGE['strings']['bookmark_add']);}, MOUNTHOOD_STORAGE['message_timeout']/4);
});
} else
mounthood_message_warning(MOUNTHOOD_STORAGE['strings']['bookmark_exists'], MOUNTHOOD_STORAGE['strings']['bookmark_add']);
e.preventDefault();
return false;
});
jQuery('.bookmarks_list').on('click', '.bookmarks_delete', function(e){
"use strict";
var idx=jQuery(this).parent().index();
var list=mounthood_get_cookie('mounthood_bookmarks');
if(list){
try {
list=JSON.parse(list);
} catch (e){}
if(list.length){
list.splice(idx, 1);
mounthood_set_cookie('mounthood_bookmarks', JSON.stringify(list), 365);
}}
jQuery(this).parent().remove();
e.preventDefault();
return false;
});
jQuery('.scroll_to_top').on('click', function(e){
"use strict";
jQuery('html,body').animate({
scrollTop: 0
}, 'slow');
e.preventDefault();
return false;
});
if(MOUNTHOOD_STORAGE['ajax_views_counter']!==undefined){
setTimeout(function(){
jQuery.post(MOUNTHOOD_STORAGE['ajax_url'], {
action: 'post_counter',
nonce: MOUNTHOOD_STORAGE['ajax_nonce'],
post_id: MOUNTHOOD_STORAGE['ajax_views_counter']['post_id'],
views: MOUNTHOOD_STORAGE['ajax_views_counter']['post_views']
});
}, 10);
}
mounthood_show_system_message();
mounthood_init_post_formats();
if(window.mounthood_sc_init_actions) mounthood_sc_init_actions();
if(window.mounthood_init_hidden_elements) mounthood_init_hidden_elements(jQuery('body').eq(0));
}
function mounthood_scroll_actions(){
"use strict";
if(window.mounthood_theme_scroll_actions) mounthood_theme_scroll_actions();
var scroll_offset=jQuery(window).scrollTop();
var scroll_to_top_button=jQuery('.scroll_to_top');
var adminbar_height=Math.max(0, jQuery('#wpadminbar').height());
if(MOUNTHOOD_STORAGE['top_panel_height'] < 1){
MOUNTHOOD_STORAGE['top_panel_height']=Math.max(0, jQuery('.top_panel_wrap').height());
}
if(scroll_offset > MOUNTHOOD_STORAGE['top_panel_height'])
scroll_to_top_button.addClass('show');
else
scroll_to_top_button.removeClass('show');
if(!jQuery('body').hasClass('menu_mobile')&&MOUNTHOOD_STORAGE['menu_fixed']){
var slider_height=0;
if(jQuery('.top_panel_below .slider_wrap').length > 0){
slider_height=jQuery('.top_panel_below .slider_wrap').height();
if(slider_height < 10){
slider_height=jQuery('.slider_wrap').hasClass('.slider_fullscreen') ? jQuery(window).height():MOUNTHOOD_STORAGE['slider_height'];
}}
if(scroll_offset <=slider_height + MOUNTHOOD_STORAGE['top_panel_height']){
if(jQuery('body').hasClass('top_panel_fixed')){
jQuery('body').removeClass('top_panel_fixed');
}}else if(scroll_offset > slider_height + MOUNTHOOD_STORAGE['top_panel_height']){
if(!jQuery('body').hasClass('top_panel_fixed')&&jQuery(document).height() > jQuery(window).height()*1.5){
jQuery('.top_panel_fixed_wrap').height(MOUNTHOOD_STORAGE['top_panel_height']);
jQuery('.top_panel_wrap').css('marginTop', '-150px').animate({'marginTop': 0}, 500);
jQuery('body').addClass('top_panel_fixed');
}}
}
if(jQuery('.sidebar_outer').length > 0){
if(MOUNTHOOD_STORAGE['side_panel_height']==0)
MOUNTHOOD_STORAGE['side_panel_height']=jQuery('.sidebar_outer_logo_wrap').outerHeight() + jQuery('.sidebar_outer_menu').outerHeight() + jQuery('.sidebar_outer_widgets').outerHeight();
if(scroll_offset + jQuery(window).height() > MOUNTHOOD_STORAGE['side_panel_height'] + 100){
if(jQuery('.sidebar_outer').css('position')!=='fixed'){
jQuery('.sidebar_outer').css({
'position': 'fixed',
'top': Math.min(0, jQuery(window).height() - MOUNTHOOD_STORAGE['side_panel_height'] - 100) + 'px',
});
}}else{
if(jQuery('.sidebar_outer').css('position')=='fixed'){
jQuery('.sidebar_outer').css({
'position': 'absolute',
'top': 0
});
}}
}
jQuery('#toc .toc_item').each(function(){
"use strict";
var id=jQuery(this).find('a').attr('href');
var pos=id.indexOf('#');
if(pos < 0||id.length==1) return;
var loc=window.location.href;
var pos2=loc.indexOf('#');
if(pos2 > 0) loc=loc.substring(0, pos2);
var now=pos==0;
if(!now) now=loc==href.substring(0, pos);
if(!now) return;
var off=jQuery(id).offset().top;
var id_next=jQuery(this).next().find('a').attr('href');
var off_next=id_next ? jQuery(id_next).offset().top:1000000;
if(off < scroll_offset + jQuery(window).height()*0.8&&scroll_offset + MOUNTHOOD_STORAGE['top_panel_height'] < off_next)
jQuery(this).addClass('current');
else
jQuery(this).removeClass('current');
});
mounthood_infinite_scroll()
mounthood_parallax_scroll();
if(window.mounthood_sc_scroll_actions) mounthood_sc_scroll_actions();
}
function mounthood_infinite_scroll(){
"use strict";
if(MOUNTHOOD_STORAGE['viewmore_busy']) return;
var infinite=jQuery('#viewmore.pagination_infinite');
if(infinite.length > 0){
var viewmore=infinite.find('#viewmore_link:not(.viewmore_empty)');
if(viewmore.length > 0){
if(jQuery(window).scrollTop() + jQuery(window).height() + 100 >=infinite.offset().top){
viewmore.eq(0).trigger('click');
}}
}}
function mounthood_parallax_scroll(){
jQuery('.sc_parallax').each(function(){
var windowHeight=jQuery(window).height();
var scrollTops=jQuery(window).scrollTop();
var offsetPrx=Math.max(jQuery(this).offset().top, windowHeight);
if(offsetPrx <=scrollTops + windowHeight){
var speed=Number(jQuery(this).data('parallax-speed'));
var xpos=jQuery(this).data('parallax-x-pos');
var ypos=Math.round((offsetPrx - scrollTops - windowHeight) * speed + (speed < 0 ? windowHeight*speed:0));
jQuery(this).find('.sc_parallax_content').css('backgroundPosition', xpos+' '+ypos+'px');
jQuery(this).find('div.sc_video_bg').css('top', ypos+'px');
}});
}
function mounthood_resize_actions(){
"use strict";
if(window.mounthood_theme_resize_actions) mounthood_theme_resize_actions();
if(!jQuery('body').hasClass('top_panel_fixed')) MOUNTHOOD_STORAGE['top_panel_height']=0;
mounthood_responsive_menu();
mounthood_vc_row_fullwidth_to_boxed();
mounthood_video_dimensions();
mounthood_resize_video_background();
mounthood_resize_fullscreen_slider();
mounthood_resize_alter_portfolio();
mounthood_stretch_width();
if(window.mounthood_sc_resize_actions) mounthood_sc_resize_actions();
}
function mounthood_stretch_width(){
jQuery('.trx-stretch-width').each(function(){
var $el=jQuery(this);
var $el_full=$el.next('.trx-stretch-width-original');
var el_margin_left=parseInt($el.css('margin-left'), 10);
var el_margin_right=parseInt($el.css('margin-right'), 10);
var offset=0 - $el_full.offset().left - el_margin_left;
var width=jQuery(window).width();
if(!$el.hasClass('inited')){
$el.addClass('inited invisible');
$el.css({
'position': 'relative',
'box-sizing': 'border-box'
});
}
$el.css({
'left': offset,
'width': jQuery(window).width()
});
if(!$el.hasClass('trx-stretch-content')){
var padding=Math.max(0, -1*offset);
var paddingRight=Math.max(0, width - padding - $el_full.width() + el_margin_left + el_margin_right);
$el.css({ 'padding-left': padding + 'px', 'padding-right': paddingRight + 'px' });
}
$el.removeClass('invisible');
});
}
function mounthood_vc_row_fullwidth_to_boxed(){
"use strict";
if(jQuery('body').hasClass('body_style_boxed')){
var width_body=jQuery('body').width();
var width_content=jQuery('.page_wrap').width();
var width_content_wrap=jQuery('.page_content_wrap .content_wrap').width();
var indent=(width_content - width_content_wrap) / 2;
if(width_body > width_content){
jQuery('.vc_row[data-vc-full-width="true"]').each(function(){
"use strict";
var mrg=parseInt(jQuery(this).css('marginLeft'));
jQuery(this).css({
'width': width_content,
'left': -indent-mrg,
'padding-left': indent+mrg,
'padding-right': indent+mrg
});
if(jQuery(this).attr('data-vc-stretch-content')){
jQuery(this).css({
'padding-left': 0,
'padding-right': 0
});
}});
}}
}
function mounthood_responsive_menu(){
"use strict";
if(mounthood_is_responsive_need(MOUNTHOOD_STORAGE['menu_mobile'])){
if(!jQuery('body').hasClass('menu_mobile')){
jQuery('body').removeClass('top_panel_fixed').addClass('menu_mobile');
jQuery('header.top_panel_wrap ').hide();
jQuery('.header_mobile').show();
jQuery('header #popup_login').attr('id', 'popup_login_1');
jQuery('header #popup_registration').attr('id', 'popup_registration_1');
jQuery('.header_mobile #popup_login_1').attr('id', 'popup_login');
jQuery('.header_mobile #popup_registration_1').attr('id', 'popup_registration');
}}else{
if(jQuery('body').hasClass('menu_mobile')){
jQuery('body').removeClass('menu_mobile');
jQuery('header.top_panel_wrap ').show();
jQuery('.header_mobile').hide();
jQuery('header #popup_login_1').attr('id', 'popup_login');
jQuery('header #popup_registration_1').attr('id', 'popup_registration');
jQuery('.header_mobile #popup_login').attr('id', 'popup_login_1');
jQuery('.header_mobile #popup_registration').attr('id', 'popup_registration_1');
}}
if(jQuery(window).width() < 640){
var pass=jQuery('.header_mobile .popup_wrap.popup_registration .registration_form > .form_right');
if(pass.length > 0){
jQuery('.header_mobile .popup_wrap.popup_registration .form_left .popup_form_field.email_field').after(pass);
}}else{
var pass=jQuery('.header_mobile .popup_wrap.popup_registration .form_left > .form_right');
if(pass.length > 0){
jQuery('.header_mobile .popup_wrap.popup_registration .registration_form').append(pass);
}}
if(!jQuery('.top_panel_wrap').hasClass('menu_show')) jQuery('.top_panel_wrap').addClass('menu_show');
if(jQuery('.sidebar_outer').length > 0&&jQuery('.sidebar_outer').css('position')=='absolute'&&jQuery('.sidebar_outer_widgets:visible').length==0)
jQuery('.sidebar_outer_widgets').show();
var cat_menu=jQuery('body:not(.woocommerce) .widget_area:not(.footer_wrap) .widget_product_categories ul.product-categories');
var sb=cat_menu.parents('.widget_area');
if(sb.length > 0&&cat_menu.length > 0){
if(sb.width()==sb.parents('.content_wrap').width()){
if(cat_menu.hasClass('inited')){
cat_menu.removeClass('inited').addClass('plain').superfish('destroy');
cat_menu.find('ul.animated').removeClass('animated').addClass('no_animated');
}}else{
if(!cat_menu.hasClass('inited')){
cat_menu.removeClass('plain').addClass('inited');
cat_menu.find('ul.no_animated').removeClass('no_animated').addClass('animated');
mounthood_init_sfmenu('body:not(.woocommerce) .widget_area:not(.footer_wrap) .widget_product_categories ul.product-categories');
}}
}}
function mounthood_is_responsive_need(max_width){
"use strict";
var rez=false;
if(max_width > 0){
var w=window.innerWidth;
if(w==undefined){
w=jQuery(window).width()+(jQuery(window).height() < jQuery(document).height()||jQuery(window).scrollTop() > 0 ? 16:0);
}
rez=max_width > w;
}
return rez;
}
function mounthood_video_dimensions(){
jQuery('.sc_video_frame').each(function(){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
var frame=jQuery(this).eq(0);
var player=frame.parent();
var ratio=(frame.data('ratio') ? frame.data('ratio').split(':'):(frame.find('[data-ratio]').length>0 ? frame.find('[data-ratio]').data('ratio').split(':'):[16,9]));
ratio=ratio.length!=2||ratio[0]==0||ratio[1]==0 ? 16/9:ratio[0]/ratio[1];
var w_attr=frame.data('width');
var h_attr=frame.data('height');
if(!w_attr||!h_attr) return;
var percent=(''+w_attr).substr(-1)=='%';
w_attr=parseInt(w_attr);
h_attr=parseInt(h_attr);
var w_real=Math.min(percent||frame.parents('.columns_wrap').length>0 ? 10000:w_attr, frame.parents('div,article').width()), //player.width();
h_real=Math.round(percent ? w_real/ratio:w_real/w_attr*h_attr);
if(parseInt(frame.attr('data-last-width'))==w_real) return;
if(percent){
frame.height(h_real);
}else{
frame.css({'width': w_real+'px', 'height': h_real+'px'});
}
frame.attr('data-last-width', w_real);
});
jQuery('video.sc_video,video.wp-video-shortcode').each(function(){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
var video=jQuery(this).eq(0);
var ratio=(video.data('ratio')!=undefined ? video.data('ratio').split(':'):[16,9]);
ratio=ratio.length!=2||ratio[0]==0||ratio[1]==0 ? 16/9:ratio[0]/ratio[1];
var mejs_cont=video.parents('.mejs-video');
var frame=video.parents('.sc_video_frame');
var w_attr=frame.length>0 ? frame.data('width'):video.data('width');
var h_attr=frame.length>0 ? frame.data('height'):video.data('height');
if(!w_attr||!h_attr){
w_attr=video.attr('width');
h_attr=video.attr('height');
if(!w_attr||!h_attr) return;
video.data({'width': w_attr, 'height': h_attr});
}
var percent=(''+w_attr).substr(-1)=='%';
w_attr=parseInt(w_attr);
h_attr=parseInt(h_attr);
var w_real=Math.round(mejs_cont.length > 0 ? Math.min(percent ? 10000:w_attr, mejs_cont.parents('div,article').width()):video.width()),
h_real=Math.round(percent ? w_real/ratio:w_real/w_attr*h_attr);
if(parseInt(video.attr('data-last-width'))==w_real) return;
if(mejs_cont.length > 0&&mejs){
mounthood_set_mejs_player_dimensions(video, w_real, h_real);
}
if(percent){
video.height(h_real);
}else{
video.attr({'width': w_real, 'height': h_real}).css({'width': w_real+'px', 'height': h_real+'px'});
}
video.attr('data-last-width', w_real);
});
jQuery('video.sc_video_bg').each(function(){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
var video=jQuery(this).eq(0);
var ratio=(video.data('ratio')!=undefined ? video.data('ratio').split(':'):[16,9]);
ratio=ratio.length!=2||ratio[0]==0||ratio[1]==0 ? 16/9:ratio[0]/ratio[1];
var mejs_cont=video.parents('.mejs-video');
var container=mejs_cont.length>0 ? mejs_cont.parent():video.parent();
var w=container.width();
var h=container.height();
var w1=Math.ceil(h*ratio);
var h1=Math.ceil(w/ratio);
if(video.parents('.sc_parallax').length > 0){
var windowHeight=jQuery(window).height();
var speed=Number(video.parents('.sc_parallax').data('parallax-speed'));
var h_add=Math.ceil(Math.abs((windowHeight-h)*speed));
if(h1 < h + h_add){
h1=h + h_add;
w1=Math.ceil(h1 * ratio);
}}
if(h1 < h){
h1=h;
w1=Math.ceil(h1 * ratio);
}
if(w1 < w){
w1=w;
h1=Math.ceil(w1 / ratio);
}
var l=Math.round((w1-w)/2);
var t=Math.round((h1-h)/2);
if(parseInt(video.attr('data-last-width'))==w1) return;
if(mejs_cont.length > 0){
mounthood_set_mejs_player_dimensions(video, w1, h1);
mejs_cont.css({
'top': -t+'px'
});
} else
video.css({
'top': -t+'px'
});
video.attr({'width': w1, 'height': h1, 'data-last-width':w1}).css({'width':w1+'px', 'height':h1+'px'});
if(video.css('opacity')==0) video.animate({'opacity': 1}, 3000);
});
jQuery('iframe').each(function(){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
var iframe=jQuery(this).eq(0);
var ratio=(iframe.data('ratio')!=undefined ? iframe.data('ratio').split(':'):(iframe.find('[data-ratio]').length>0 ? iframe.find('[data-ratio]').data('ratio').split(':'):[16,9]));
ratio=ratio.length!=2||ratio[0]==0||ratio[1]==0 ? 16/9:ratio[0]/ratio[1];
var w_attr=iframe.attr('width');
var h_attr=iframe.attr('height');
var frame=iframe.parents('.sc_video_frame');
if(frame.length > 0){
w_attr=frame.data('width');
h_attr=frame.data('height');
}
if(!w_attr||!h_attr){
return;
}
var percent=(''+w_attr).substr(-1)=='%';
w_attr=parseInt(w_attr);
h_attr=parseInt(h_attr);
var w_real=frame.length > 0 ? frame.width():iframe.width(),
h_real=Math.round(percent ? w_real/ratio:w_real/w_attr*h_attr);
if(parseInt(iframe.attr('data-last-width'))==w_real) return;
iframe.css({'width': w_real+'px', 'height': h_real+'px'});
});
}
function mounthood_resize_video_background(){
"use strict";
var bg=jQuery('.video_bg');
if(bg.length < 1)
return;
if(MOUNTHOOD_STORAGE['media_elements_enabled']&&bg.find('.mejs-video').length==0){
setTimeout(mounthood_resize_video_background, 100);
return;
}
var video=bg.find('video');
var ratio=(video.data('ratio')!=undefined ? video.data('ratio').split(':'):[16,9]);
ratio=ratio.length!=2||ratio[0]==0||ratio[1]==0 ? 16/9:ratio[0]/ratio[1];
var w=bg.width();
var h=bg.height();
var w1=Math.ceil(h*ratio);
var h1=Math.ceil(w/ratio);
if(h1 < h){
h1=h;
w1=Math.ceil(h1 * ratio);
}
if(w1 < w){
w1=w;
h1=Math.ceil(w1 / ratio);
}
var l=Math.round((w1-w)/2);
var t=Math.round((h1-h)/2);
if(bg.find('.mejs-container').length > 0){
mounthood_set_mejs_player_dimensions(bg.find('video'), w1, h1);
bg.find('.mejs-container').css({'left': -l+'px', 'top': -t+'px'});
} else
bg.find('video').css({'left': -l+'px', 'top': -t+'px'});
bg.find('video').attr({'width': w1, 'height': h1}).css({'width':w1+'px', 'height':h1+'px'});
}
function mounthood_set_mejs_player_dimensions(video, w, h){
"use strict";
if(mejs){
for (var pl in mejs.players){
if(mejs.players[pl].media.src==video.attr('src')){
if(mejs.players[pl].media.setVideoSize){
mejs.players[pl].media.setVideoSize(w, h);
}
mejs.players[pl].setPlayerSize(w, h);
mejs.players[pl].setControlsSize();
}}
}}
function mounthood_resize_fullscreen_slider(){
"use strict";
var slider_wrap=jQuery('.slider_wrap.slider_fullscreen');
if(slider_wrap.length < 1)
return;
var slider=slider_wrap.find('.sc_slider_swiper');
if(slider.length < 1)
return;
var h=jQuery(window).height() - jQuery('#wpadminbar').height() - (jQuery('body').hasClass('top_panel_above')&&!jQuery('body').hasClass('.top_panel_fixed') ? jQuery('.top_panel_wrap').height():0);
slider.height(h);
}
function mounthood_resize_alter_portfolio(){
"use strict";
var wrap=jQuery('.isotope_wrap.inited');
if(wrap.length==0) return;
wrap.each(function(){
"use strict";
var alter=jQuery(this).find('.post_item_alter');
if(alter.length==0) return;
var single=alter.find('.post_featured img[data-alter-items-w="1"]').eq(0);
if(single.length!=1) return;
var w_real=single.width();
var h_real=single.height();
var space=Number(single.data('alter-item-space'));
var relayout=false;
alter.find('.post_featured img').each(function(){
"use strict";
var items_w=Number(jQuery(this).data('alter-items-w'));
var items_h=Number(jQuery(this).data('alter-items-h'));
if(items_h > 1){
jQuery(this).height(Math.round(items_h*h_real+(items_h-1)*(space+1)));
relayout=true;
}else if(items_w > 1){
jQuery(this).height(h_real);
relayout=true;
}});
if(relayout){
jQuery(this).isotope('layout');
}});
}
function mounthood_init_sfmenu(selector){
jQuery(selector).show().each(function(){
if(mounthood_is_responsive_need()&&(jQuery(this).attr('id')=='menu_main'||jQuery(this).attr('id')=='menu_side')) return;
jQuery(this).addClass('inited').superfish({
delay: 500,
animation: {
opacity: 'show'
},
animationOut: {
opacity: 'hide'
},
speed: MOUNTHOOD_STORAGE['css_animation'] ? 500:200,
speedOut: MOUNTHOOD_STORAGE['css_animation'] ? 500:200,
autoArrows: false,
dropShadows: false,
onBeforeShow: function(ul){
if(jQuery(this).parents("ul").length > 1){
var w=jQuery(window).width();
var par_offset=jQuery(this).parents("ul").offset().left;
var par_width=jQuery(this).parents("ul").outerWidth();
var ul_width=jQuery(this).outerWidth();
if(par_offset+par_width+ul_width > w-20&&par_offset-ul_width > 0)
jQuery(this).addClass('submenu_left');
else
jQuery(this).removeClass('submenu_left');
}
if(MOUNTHOOD_STORAGE['css_animation']){
jQuery(this).removeClass('animated fast '+MOUNTHOOD_STORAGE['menu_animation_out']);
jQuery(this).addClass('animated fast '+MOUNTHOOD_STORAGE['menu_animation_in']);
}},
onBeforeHide: function(ul){
if(MOUNTHOOD_STORAGE['css_animation']){
jQuery(this).removeClass('animated fast '+MOUNTHOOD_STORAGE['menu_animation_in']);
jQuery(this).addClass('animated fast '+MOUNTHOOD_STORAGE['menu_animation_out']);
}}
});
});
}
function mounthood_build_page_toc(){
"use strict";
var toc='', toc_count=0;
jQuery('[id^="toc_"],.sc_anchor').each(function(idx){
"use strict";
var obj=jQuery(this);
var id=obj.attr('id');
var url=obj.data('url');
var icon=obj.data('icon');
if(!icon) icon='icon-circle-dot';
var title=obj.attr('title');
var description=obj.data('description');
var separator=obj.data('separator');
toc_count++;
toc +='';
});
if(toc_count > (MOUNTHOOD_STORAGE['toc_menu_home'] ? 1:0) + (MOUNTHOOD_STORAGE['toc_menu_top'] ? 1:0)){
if(jQuery('#toc').length > 0)
jQuery('#toc .toc_inner').html(toc);
else
jQuery('body').append('');
}}
function mounthood_show_current_menu_item(menu, button){
"use strict";
menu.find('a').each(function (){
var menu_link=jQuery(this);
if(menu_link.text()==""){
return;
}
if(menu_link.attr('href')==window.location.href)
button.text(menu_link.text());
});
}
function mounthood_init_isotope(){
"use strict";
var all_images_complete=true;
jQuery('.isotope_wrap:not(.inited)').each(function (){
"use strict";
all_images_complete=all_images_complete&&mounthood_check_images_complete(jQuery(this));
});
if(!all_images_complete&&MOUNTHOOD_STORAGE['isotope_init_counter']++ < 30){
setTimeout(mounthood_init_isotope, 200);
return;
}
jQuery('.isotope_filters:not(.inited)').addClass('inited').on('click', 'a', function(e){
"use strict";
jQuery(this).parents('.isotope_filters').find('a').removeClass('active');
jQuery(this).addClass('active');
var selector=jQuery(this).data('filter');
jQuery(this).parents('.isotope_filters').siblings('.isotope_wrap').eq(0).isotope({
filter: selector
});
if(selector=='*')
jQuery('#viewmore_link').fadeIn();
else
jQuery('#viewmore_link').fadeOut();
e.preventDefault();
return false;
});
jQuery('.isotope_wrap:not(.inited)').each(function(){
"use strict";
var isotope_container=jQuery(this);
mounthood_sc_init(isotope_container);
if(isotope_container.parents('.sc_scroll').length > 0){
isotope_container.addClass('inited').find('.isotope_item').animate({opacity: 1}, 200, function (){ jQuery(this).addClass('isotope_item_show'); });
return;
}
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
setTimeout(function(){
isotope_container.addClass('inited').isotope({
itemSelector: '.isotope_item',
animationOptions: {
duration: 750,
easing: 'linear',
queue: false
}});
isotope_container.find('.isotope_item').animate({opacity: 1}, 200, function (){
jQuery(this).addClass('isotope_item_show');
});
mounthood_resize_alter_portfolio();
}, 500);
});
}
function mounthood_init_appended_isotope(posts_container, filters){
"use strict";
if(posts_container.parents('.sc_scroll_horizontal').length > 0) return;
if(!mounthood_check_images_complete(posts_container)&&MOUNTHOOD_STORAGE['isotope_init_counter']++ < 30){
setTimeout(function(){ mounthood_init_appended_isotope(posts_container, filters); }, 200);
return;
}
var flt=posts_container.siblings('.isotope_filter');
for (var i in filters){
if(flt.find('a[data-filter=".flt_'+i+'"]').length==0){
flt.append(''+filters[i]+'');
}}
mounthood_sc_init(posts_container);
var elems=posts_container.find('.isotope_item:not(.isotope_item_show)');
setTimeout(function(){
posts_container.isotope('appended', elems);
elems.animate({opacity: 1}, 200, function (){ jQuery(this).addClass('isotope_item_show'); });
}, 500);
}
function mounthood_init_post_formats(){
"use strict";
if(window.mounthood_theme_init_post_formats) mounthood_theme_init_post_formats();
mounthood_init_media_elements(jQuery('body'));
if(jQuery('.isotope_wrap:not(.inited)').length > 0){
MOUNTHOOD_STORAGE['isotope_init_counter']=0;
mounthood_init_isotope();
}
if(jQuery('.isotope_wrap .isotope_item_content.square.effect_dir:not(.inited)').length > 0){
jQuery('.isotope_wrap .isotope_item_content.square.effect_dir:not(.inited)').each(function(){
jQuery(this).addClass('inited').hoverdir();
});
}
if(MOUNTHOOD_STORAGE['popup_engine']=='pretty'){
jQuery("a[href$='jpg'],a[href$='jpeg'],a[href$='png'],a[href$='gif']").attr('rel', 'prettyPhoto[slideshow]');
var images=jQuery("a[rel*='prettyPhoto']:not(.inited):not(.esgbox):not([data-rel*='pretty']):not([rel*='magnific']):not([data-rel*='magnific'])").addClass('inited');
try {
images.prettyPhoto({
social_tools: '',
theme: 'facebook',
deeplinking: false
});
} catch (e){};}else if(MOUNTHOOD_STORAGE['popup_engine']=='magnific'){
jQuery("a[href$='jpg'],a[href$='jpeg'],a[href$='png'],a[href$='gif']").each(function(){
if(!jQuery(this).parent().hasClass('woocommerce-product-gallery__image'))
jQuery(this).attr('rel', 'magnific');
});
var images=jQuery("a[rel*='magnific']:not(.inited):not(.esgbox):not(.prettyphoto):not([rel*='pretty']):not([data-rel*='pretty'])").addClass('inited');
try {
images.magnificPopup({
type: 'image',
mainClass: 'mfp-img-mobile',
closeOnContentClick: true,
closeBtnInside: true,
fixedContentPos: true,
midClick: true,
preloader: true,
tLoading: MOUNTHOOD_STORAGE['strings']['magnific_loading'],
gallery:{
enabled: true
},
image: {
tError: MOUNTHOOD_STORAGE['strings']['magnific_error'],
verticalFit: true
}});
} catch (e){};}
jQuery(".post_item_product .product .images .woocommerce-product-gallery__image:first a:not(.hover_icon)").addClass('hover_icon hover_icon_view');
if(jQuery('.post_counters_likes:not(.inited)').length > 0){
jQuery('.post_counters_likes:not(.inited)')
.addClass('inited')
.on('click', function(e){
var button=jQuery(this);
var inc=button.hasClass('enabled') ? 1:-1;
var post_id=button.data('postid');
var likes=Number(button.data('likes'))+inc;
var cookie_likes=mounthood_get_cookie('mounthood_likes');
if(cookie_likes===undefined||cookie_likes===null) cookie_likes='';
jQuery.post(MOUNTHOOD_STORAGE['ajax_url'], {
action: 'post_counter',
nonce: MOUNTHOOD_STORAGE['ajax_nonce'],
post_id: post_id,
likes: likes
}).done(function(response){
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: MOUNTHOOD_STORAGE['ajax_error'] };
console.log(response);
}
if(rez.error===''){
if(inc==1){
var title=button.data('title-dislike');
button.removeClass('enabled').addClass('disabled');
cookie_likes +=(cookie_likes.substr(-1)!=',' ? ',':'') + post_id + ',';
}else{
var title=button.data('title-like');
button.removeClass('disabled').addClass('enabled');
cookie_likes=cookie_likes.replace(','+post_id+',', ',');
}
button.data('likes', likes).attr('title', title).find('.post_counters_number').html(likes);
mounthood_set_cookie('mounthood_likes', cookie_likes, 365);
}else{
mounthood_message_warning(MOUNTHOOD_STORAGE['strings']['error_like']);
}});
e.preventDefault();
return false;
});
}
if(jQuery('.sc_socials_share:not(.inited)').length > 0){
jQuery('.sc_socials_share:not(.inited)').each(function(){
"use strict";
jQuery(this).addClass('inited').on('click', '.social_item_popup > a.social_icons', function(e){
"use strict";
var url=jQuery(this).data('link');
window.open(url, '_blank', 'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=480, height=400, toolbar=0, status=0');
e.preventDefault();
return false;
});
});
}
if(jQuery('.sc_video_play_button:not(.inited)').length > 0){
jQuery('.sc_video_play_button:not(.inited)').each(function(){
"use strict";
jQuery(this)
.addClass('inited')
.animate({opacity: 1}, 1000)
.on('click', function (e){
"use strict";
if(!jQuery(this).hasClass('sc_video_play_button')) return;
var video=jQuery(this).removeClass('sc_video_play_button hover_icon icon-play-outline').data('video');
if(video!==''){
jQuery(this).empty().html(video);
mounthood_video_dimensions();
var video_tag=jQuery(this).find('video');
var w=video_tag.width();
var h=video_tag.height();
mounthood_init_media_elements(jQuery(this));
jQuery(this).find('video').css({'width':w, 'height': h}).attr({'width':w, 'height': h});
}
e.preventDefault();
return false;
});
});
}}
function mounthood_init_media_elements(cont){
if(MOUNTHOOD_STORAGE['media_elements_enabled']&&cont.find('audio,video').length > 0){
if(window.mejs){
if(window.mejs.MepDefaults!=undefined) window.mejs.MepDefaults.enableAutosize=false;
if(window.mejs.MediaElementDefaults!=undefined) window.mejs.MediaElementDefaults.enableAutosize=false;
cont.find('audio:not(.wp-audio-shortcode),video:not(.wp-video-shortcode)').each(function(){
if(jQuery(this).parents('.mejs-mediaelement').length==0){
var media_tag=jQuery(this);
var settings={
enableAutosize: true,
videoWidth: -1,
videoHeight: -1,
audioWidth: '100%',
audioHeight: 30,
success: function(mejs){
var autoplay, loop;
if('flash'===mejs.pluginType){
autoplay=mejs.attributes.autoplay&&'false'!==mejs.attributes.autoplay;
loop=mejs.attributes.loop&&'false'!==mejs.attributes.loop;
autoplay&&mejs.addEventListener('canplay', function (){
mejs.play();
}, false);
loop&&mejs.addEventListener('ended', function (){
mejs.play();
}, false);
}
media_tag.parents('.sc_audio,.sc_video').addClass('inited sc_show');
}};
jQuery(this).mediaelementplayer(settings);
}});
} else
setTimeout(function(){ mounthood_init_media_elements(cont); }, 400);
}}
function mounthood_show_system_message(){
if(MOUNTHOOD_STORAGE['system_message']&&MOUNTHOOD_STORAGE['system_message']['message']){
if(MOUNTHOOD_STORAGE['system_message']['status']=='success')
mounthood_message_success(MOUNTHOOD_STORAGE['system_message']['message'], MOUNTHOOD_STORAGE['system_message']['header']);
else if(MOUNTHOOD_STORAGE['system_message']['status']=='info')
mounthood_message_info(MOUNTHOOD_STORAGE['system_message']['message'], MOUNTHOOD_STORAGE['system_message']['header']);
else if(MOUNTHOOD_STORAGE['system_message']['status']=='error'||MOUNTHOOD_STORAGE['system_message']['status']=='warning')
mounthood_message_warning(MOUNTHOOD_STORAGE['system_message']['message'], MOUNTHOOD_STORAGE['system_message']['header']);
}}
function mounthood_toggle_popup(popup){
if(popup.css('display')!='none')
mounthood_hide_popup(popup);
else
mounthood_show_popup(popup);
}
function mounthood_show_popup(popup){
if(popup.css('display')=='none'){
if(false&&MOUNTHOOD_STORAGE['css_animation'])
popup.show().removeClass('animated fast '+MOUNTHOOD_STORAGE['menu_animation_out']).addClass('animated fast '+MOUNTHOOD_STORAGE['menu_animation_in']);
else
popup.slideDown();
}}
function mounthood_hide_popup(popup){
if(popup.css('display')!='none'){
if(false&&MOUNTHOOD_STORAGE['css_animation'])
popup.removeClass('animated fast '+MOUNTHOOD_STORAGE['menu_animation_in']).addClass('animated fast '+MOUNTHOOD_STORAGE['menu_animation_out']).delay(500).hide();
else
popup.fadeOut();
}};
function mounthood_theme_ready_actions(){
"use strict";
}
function mounthood_theme_scroll_actions(){
"use strict";
}
function mounthood_theme_resize_actions(){
"use strict";
}
function mounthood_theme_sc_init(cont){
"use strict";
}
function mounthood_theme_init_post_formats(){
"use strict";
jQuery('a.tribe-events-read-more,.tribe-events-button,.tribe-events-nav-previous a,.tribe-events-nav-next a,.tribe-events-widget-link a,.tribe-events-viewmore a')
.addClass('sc_button sc_button_style_filled');
if(MOUNTHOOD_STORAGE['button_hover']&&MOUNTHOOD_STORAGE['button_hover']!='default'){
jQuery('button:not(.search_submit):not([class*="sc_button_hover_"]),\
.sc_button:not(.sc_button_style_border):not([class*="sc_button_hover_"]),\
.woocommerce .button:not([class*="sc_button_hover_"]),.woocommerce-page .button:not([class*="sc_button_hover_"]),\
#buddypress a.button:not([class*="sc_button_hover_"])'
).addClass('sc_button_hover_'+MOUNTHOOD_STORAGE['button_hover']);
if(MOUNTHOOD_STORAGE['button_hover']!='arrow')
jQuery('input[type="submit"]:not([class*="sc_button_hover_"]),\
input[type="button"]:not([class*="sc_button_hover_"]),\
.isotope_filters_button,\
.scroll_to_top:not([class*="sc_button_hover_"]),\
.sc_slider_prev:not([class*="sc_button_hover_"]),.sc_slider_next:not([class*="sc_button_hover_"]),\
.tagcloud > a:not([class*="sc_button_hover_"])'
).addClass('sc_button_hover_'+MOUNTHOOD_STORAGE['button_hover']);
jQuery('.pswp__button').removeClass('sc_button_hover_'+MOUNTHOOD_STORAGE['button_hover']);
}
jQuery('[class*="sc_input_hover_"] input, [class*="sc_input_hover_"] textarea').each(function(){
if(jQuery(this).val()!='')
jQuery(this).addClass('filled');
else
jQuery(this).removeClass('filled');
});
jQuery('[class*="sc_input_hover_"] input, [class*="sc_input_hover_"] textarea').on('blur', function(){
if(jQuery(this).val()!='')
jQuery(this).addClass('filled');
else
jQuery(this).removeClass('filled');
});
}
function mounthood_theme_googlemap_styles($styles){
"use strict";
$styles['greyscale']=[
{ "stylers": [
{ "saturation": -100 }
]
}
];
$styles['inverse']=[
{ "stylers": [
{ "invert_lightness": true },
{ "visibility": "on" }
]
}
];
$styles['simple']=[
{ stylers: [
{ hue: "#00ffe6" },
{ saturation: -20 }
]
},
{ featureType: "road",
elementType: "geometry",
stylers: [
{ lightness: 100 },
{ visibility: "simplified" }
]
},
{ featureType: "road",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}
];
$styles['apple']=[
{ "featureType": "landscape.man_made",
"elementType": "geometry",
"stylers": [
{"color":"#f7f1df"}
]
},
{ "featureType": "landscape.natural",
"elementType": "geometry",
"stylers": [
{"color":"#d0e3b4"}
]
},
{ "featureType": "landscape.natural.terrain",
"elementType": "geometry",
"stylers": [
{"visibility":"off"}
]
},
{ "featureType": "poi",
"elementType": "labels",
"stylers": [
{"visibility":"off"}
]
},
{ "featureType": "poi.business",
"elementType": "all",
"stylers": [
{"visibility":"off"}
]
},
{ "featureType": "poi.medical",
"elementType": "geometry",
"stylers": [
{"color":"#fbd3da"}
]
},
{ "featureType": "poi.park",
"elementType": "geometry",
"stylers": [
{"color":"#bde6ab"}
]
},
{ "featureType": "road",
"elementType": "geometry.stroke",
"stylers": [
{"visibility":"off"}
]
},
{ "featureType": "road",
"elementType": "labels",
"stylers": [
{"visibility":"off"}
]
},
{ "featureType": "road.highway",
"elementType": "geometry.fill",
"stylers": [
{"color":"#ffe15f"}
]
},
{ "featureType": "road.highway",
"elementType":"geometry.stroke",
"stylers": [
{"color":"#efd151"}
]
},
{ "featureType": "road.arterial",
"elementType": "geometry.fill",
"stylers": [
{"color":"#ffffff"}
]
},
{ "featureType": "road.local",
"elementType": "geometry.fill",
"stylers": [
{"color":"black"}
]
},
{ "featureType": "transit.station.airport",
"elementType": "geometry.fill",
"stylers": [
{"color":"#cfb2db"}
]
},
{ "featureType": "water",
"elementType": "geometry",
"stylers": [
{"color":"#a2daf2"}
]
}
];
$styles['dark']=[
{
"featureType": "all",
"elementType": "labels.text.fill",
"stylers": [
{
"saturation": 36
},
{
"color": "#000000"
},
{
"lightness": 40
}
]
},
{
"featureType": "all",
"elementType": "labels.text.stroke",
"stylers": [
{
"visibility": "on"
},
{
"color": "#000000"
},
{
"lightness": 16
}
]
},
{
"featureType": "all",
"elementType": "labels.icon",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "administrative",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 20
}
]
},
{
"featureType": "administrative",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 17
},
{
"weight": 1.2
}
]
},
{
"featureType": "landscape",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 20
}
]
},
{
"featureType": "poi",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 21
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 17
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 29
},
{
"weight": 0.2
}
]
},
{
"featureType": "road.highway.controlled_access",
"elementType": "geometry",
"stylers": [
{
"color": "#99c018"
}
]
},
{
"featureType": "road.arterial",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 18
}
]
},
{
"featureType": "road.local",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 16
}
]
},
{
"featureType": "transit",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 19
}
]
},
{
"featureType": "water",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 17
}
]
}
];
return $styles;
};
!function(e,n){e.wp=e.wp||{},e.wp.mediaelement=new function(){var e={};return{initialize:function(){(e="undefined"!=typeof _wpmejsSettings?n.extend(!0,{},_wpmejsSettings):e).classPrefix="mejs-",e.success=e.success||function(e){var n,t;e.rendererName&&-1!==e.rendererName.indexOf("flash")&&(n=e.attributes.autoplay&&"false"!==e.attributes.autoplay,t=e.attributes.loop&&"false"!==e.attributes.loop,n&&e.addEventListener("canplay",function(){e.play()},!1),t&&e.addEventListener("ended",function(){e.play()},!1))},e.customError=function(e,n){if(-1!==e.rendererName.indexOf("flash")||-1!==e.rendererName.indexOf("flv"))return''+mejsL10n.strings["mejs.download-video"]+""},n(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").filter(function(){return!n(this).parent().hasClass("mejs-mediaelement")}).mediaelementplayer(e)}}},n(e.wp.mediaelement.initialize)}(window,jQuery);
!function(d,l){"use strict";var e=!1,n=!1;if(l.querySelector)if(d.addEventListener)e=!0;if(d.wp=d.wp||{},!d.wp.receiveEmbedMessage)if(d.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){for(var r,i,a,s=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),n=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),o=new RegExp("^https?:$","i"),c=0;cscreen_w?"desktop":768screen_w?"tablet":300screen_w?"mobile":300>screen_w?"mobile_portrait":""}function loadScript(url,$obj,callback){var script=document.createElement("script");script.type="text/javascript",script.readyState&&(script.onreadystatechange=function(){"loaded"!==script.readyState&&"complete"!==script.readyState||(script.onreadystatechange=null,callback())}),script.src=url,$obj.get(0).appendChild(script)}function vc_ttaActivation(){jQuery("[data-vc-accordion]").on("show.vc.accordion",function(e){var $=window.jQuery,ui={};ui.newPanel=$(this).data("vc.accordion").getTarget(),window.wpb_prepare_tab_content(e,ui)})}function vc_accordionActivate(event,ui){if(ui.newPanel.length&&ui.newHeader.length){var $pie_charts=ui.newPanel.find(".vc_pie_chart:not(.vc_ready)"),$round_charts=ui.newPanel.find(".vc_round-chart"),$line_charts=ui.newPanel.find(".vc_line-chart"),$carousel=ui.newPanel.find('[data-ride="vc_carousel"]');void 0!==jQuery.fn.isotope&&ui.newPanel.find(".isotope, .wpb_image_grid_ul").isotope("layout"),ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),vc_carouselBehaviour(ui.newPanel),vc_plugin_flexslider(ui.newPanel),$pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(),$round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({reload:!1}),$line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({reload:!1}),$carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"),ui.newPanel.parents(".isotope").length&&ui.newPanel.parents(".isotope").each(function(){jQuery(this).isotope("layout")})}}function initVideoBackgrounds(){return window.console&&window.console.warn&&window.console.warn("this function is deprecated use vc_initVideoBackgrounds"),vc_initVideoBackgrounds()}function vc_initVideoBackgrounds(){jQuery("[data-vc-video-bg]").each(function(){var youtubeUrl,youtubeId,$element=jQuery(this);$element.data("vcVideoBg")?(youtubeUrl=$element.data("vcVideoBg"),youtubeId=vcExtractYoutubeId(youtubeUrl),youtubeId&&($element.find(".vc_video-bg").remove(),insertYoutubeVideoAsBackground($element,youtubeId)),jQuery(window).on("grid:items:added",function(event,$grid){$element.has($grid).length&&vcResizeVideoBackground($element)})):$element.find(".vc_video-bg").remove()})}function insertYoutubeVideoAsBackground($element,youtubeId,counter){if("undefined"==typeof YT||void 0===YT.Player)return 100<(counter=void 0===counter?0:counter)?void console.warn("Too many attempts to load YouTube api"):void setTimeout(function(){insertYoutubeVideoAsBackground($element,youtubeId,counter++)},100);var $container=$element.prepend('').find(".inner");new YT.Player($container[0],{width:"100%",height:"100%",videoId:youtubeId,playerVars:{playlist:youtubeId,iv_load_policy:3,enablejsapi:1,disablekb:1,autoplay:1,controls:0,showinfo:0,rel:0,loop:1,wmode:"transparent"},events:{onReady:function(event){event.target.mute().setLoop(!0)}}}),vcResizeVideoBackground($element),jQuery(window).bind("resize",function(){vcResizeVideoBackground($element)})}function vcResizeVideoBackground($element){var iframeW,iframeH,marginLeft,marginTop,containerW=$element.innerWidth(),containerH=$element.innerHeight();containerW/containerH<16/9?(iframeW=containerH*(16/9),iframeH=containerH,marginLeft=-Math.round((iframeW-containerW)/2)+"px",marginTop=-Math.round((iframeH-containerH)/2)+"px",iframeW+="px",iframeH+="px"):(iframeW=containerW,iframeH=containerW*(9/16),marginTop=-Math.round((iframeH-containerH)/2)+"px",marginLeft=-Math.round((iframeW-containerW)/2)+"px",iframeW+="px",iframeH+="px"),$element.find(".vc_video-bg iframe").css({maxWidth:"1000%",marginLeft:marginLeft,marginTop:marginTop,width:iframeW,height:iframeH})}function vcExtractYoutubeId(url){if(void 0===url)return!1;var id=url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);return null!==id&&id[1]}function vc_googleMapsPointer(){var $=window.jQuery,$wpbGmapsWidget=$(".wpb_gmaps_widget");$wpbGmapsWidget.click(function(){$("iframe",this).css("pointer-events","auto")}),$wpbGmapsWidget.mouseleave(function(){$("iframe",this).css("pointer-events","none")}),$(".wpb_gmaps_widget iframe").css("pointer-events","none")}function vc_setHoverBoxPerspective(hoverBox){hoverBox.each(function(){var $this=jQuery(this),width=$this.width(),perspective=4*width+"px";$this.css("perspective",perspective)})}function vc_setHoverBoxHeight(hoverBox){hoverBox.each(function(){var $this=jQuery(this),hoverBoxInner=$this.find(".vc-hoverbox-inner");hoverBoxInner.css("min-height",0);var frontHeight=$this.find(".vc-hoverbox-front-inner").outerHeight(),backHeight=$this.find(".vc-hoverbox-back-inner").outerHeight(),hoverBoxHeight=frontHeight>backHeight?frontHeight:backHeight;hoverBoxHeight<250&&(hoverBoxHeight=250),hoverBoxInner.css("min-height",hoverBoxHeight+"px")})}function vc_prepareHoverBox(){var hoverBox=jQuery(".vc-hoverbox");vc_setHoverBoxHeight(hoverBox),vc_setHoverBoxPerspective(hoverBox)}document.documentElement.className+=" js_active ",document.documentElement.className+="ontouchstart"in document.documentElement?" vc_mobile ":" vc_desktop ",function(){for(var prefix=["-webkit-","-moz-","-ms-","-o-",""],i=0;iparseInt(ver[1]);$call.each(function(index){var $tabs,interval=jQuery(this).attr("data-interval"),tabs_array=[];if($tabs=jQuery(this).find(".wpb_tour_tabs_wrapper").tabs({show:function(event,ui){wpb_prepare_tab_content(event,ui)},beforeActivate:function(event,ui){1!==ui.newPanel.index()&&ui.newPanel.find(".vc_pie_chart:not(.vc_ready)")},activate:function(event,ui){wpb_prepare_tab_content(event,ui)}}),interval&&0index?index=$tabs.tabs("length")-1:index>=$tabs.tabs("length")&&(index=0),$tabs.tabs("select",index)}else{var index=$tabs.tabs("option","active"),length=$tabs.find(".wpb_tab").length;index=jQuery(this).parent().hasClass("wpb_next_slide")?index+1>=length?0:index+1:0>index-1?length-1:index-1,$tabs.tabs("option","active",index)}})})}}),"function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){jQuery(".wpb_accordion").each(function(index){var $tabs,$this=jQuery(this),active_tab=($this.attr("data-interval"),!isNaN(jQuery(this).data("active-tab"))&&0 div > h3",autoHeight:!1,heightStyle:"content",active:active_tab,collapsible:collapsible,navigation:!0,activate:vc_accordionActivate,change:function(event,ui){void 0!==jQuery.fn.isotope&&ui.newContent.find(".isotope").isotope("layout"),vc_carouselBehaviour(ui.newPanel)}}),!0===$this.data("vcDisableKeydown")&&($tabs.data("uiAccordion")._keydown=function(){})})}),"function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){var layout_modes={fitrows:"fitRows",masonry:"masonry"};jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){var $container=jQuery(this),$thumbs=$container.find(".wpb_thumbnails"),layout_mode=$thumbs.attr("data-layout-mode");$thumbs.isotope({itemSelector:".isotope-item",layoutMode:void 0===layout_modes[layout_mode]?"fitRows":layout_modes[layout_mode]}),$container.find(".categories_filter a").data("isotope",$thumbs).click(function(e){e.preventDefault();var $thumbs=jQuery(this).data("isotope");jQuery(this).parent().parent().find(".active").removeClass("active"),jQuery(this).parent().addClass("active"),$thumbs.isotope({filter:jQuery(this).attr("data-filter")})}),jQuery(window).bind("load resize",function(){$thumbs.isotope("layout")})})}),"function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function($parent){($parent?$parent.find(".wpb_carousel"):jQuery(".wpb_carousel")).each(function(){var $this=jQuery(this);if(!0!==$this.data("carousel_enabled")&&$this.is(":visible")){$this.data("carousel_enabled",!0),getColumnsCount(jQuery(this)),jQuery(this).hasClass("columns_count_1");var carousele_li=jQuery(this).find(".wpb_thumbnails-fluid li");carousele_li.css({"margin-right":carousele_li.css("margin-left"),"margin-left":0});var fluid_ul=jQuery(this).find("ul.wpb_thumbnails-fluid");fluid_ul.width(fluid_ul.width()+300),jQuery(window).resize(function(){var before_resize=screen_size;screen_size=getSizeName(),before_resize!=screen_size&&window.setTimeout("location.reload()",20)})}})}),"function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){jQuery(".wpb_gallery_slides").each(function(index){var $imagesGrid,this_element=jQuery(this);if(this_element.hasClass("wpb_slider_nivo")){var sliderTimeout=1e3*this_element.attr("data-interval");0===sliderTimeout&&(sliderTimeout=9999999999),this_element.find(".nivoSlider").nivoSlider({effect:"boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",slices:15,boxCols:8,boxRows:4,animSpeed:800,pauseTime:sliderTimeout,startSlide:0,directionNav:!0,directionNavHide:!0,controlNav:!0,keyboardNav:!1,pauseOnHover:!0,manualAdvance:!1,prevText:"Prev",nextText:"Next"})}else this_element.hasClass("wpb_image_grid")&&(jQuery.fn.imagesLoaded?$imagesGrid=this_element.find(".wpb_image_grid_ul").imagesLoaded(function(){$imagesGrid.isotope({itemSelector:".isotope-item",layoutMode:"fitRows"})}):this_element.find(".wpb_image_grid_ul").isotope({itemSelector:".isotope-item",layoutMode:"fitRows"}))})}),"function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){try{jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({animationSpeed:"normal",hook:"data-rel",padding:15,opacity:.7,showTitle:!0,allowresize:!0,counter_separator_label:"/",hideflash:!1,deeplinking:!1,modal:!1,callback:function(){location.href.indexOf("#!prettyPhoto")>-1&&(location.hash="")},social_tools:""})}catch(err){window.console&&window.console.log&&console.log(err)}}),"function"!=typeof window.vc_google_fonts&&(window.vc_google_fonts=function(){return!1}),window.vcParallaxSkroll=!1,"function"!=typeof window.vc_rowBehaviour&&(window.vc_rowBehaviour=function(){function fullWidthRow(){var $elements=$('[data-vc-full-width="true"]');$.each($elements,function(key,item){var $el=$(this);$el.addClass("vc_hidden");var $el_full=$el.next(".vc_row-full-width");if($el_full.length||($el_full=$el.parent().next(".vc_row-full-width")),$el_full.length){var el_margin_left=parseInt($el.css("margin-left"),10),el_margin_right=parseInt($el.css("margin-right"),10),offset=0-$el_full.offset().left-el_margin_left,width=$(window).width();if($el.css({position:"relative",left:offset,"box-sizing":"border-box",width:$(window).width()}),!$el.data("vcStretchContent")){var padding=-1*offset;0>padding&&(padding=0);var paddingRight=width-padding-$el_full.width()+el_margin_left+el_margin_right;0>paddingRight&&(paddingRight=0),$el.css({"padding-left":padding+"px","padding-right":paddingRight+"px"})}$el.attr("data-vc-full-width-init","true"),$el.removeClass("vc_hidden"),$(document).trigger("vc-full-width-row-single",{el:$el,offset:offset,marginLeft:el_margin_left,marginRight:el_margin_right,elFull:$el_full,width:width})}}),$(document).trigger("vc-full-width-row",$elements)}function fullHeightRow(){var $element=$(".vc_row-o-full-height:first");if($element.length){var $window,windowHeight,offsetTop,fullHeight;$window=$(window),windowHeight=$window.height(),offsetTop=$element.offset().top,offsetTop0||navigator.userAgent.match(/Trident.*rv\:11\./))&&$(".vc_row-o-full-height").each(function(){"flex"===$(this).css("display")&&$(this).wrap('')})}(),vc_initVideoBackgrounds(),function(){var vcSkrollrOptions,callSkrollInit=!1;window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(),$(".vc_parallax-inner").remove(),$("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"),$("[data-vc-parallax]").each(function(){var skrollrSpeed,skrollrSize,skrollrStart,skrollrEnd,$parallaxElement,parallaxImage,youtubeId;callSkrollInit=!0,"on"===$(this).data("vcParallaxOFade")&&$(this).children().attr("data-5p-top-bottom","opacity:0;").attr("data-30p-top-bottom","opacity:1;"),skrollrSize=100*$(this).data("vcParallax"),$parallaxElement=$("").addClass("vc_parallax-inner").appendTo($(this)),$parallaxElement.height(skrollrSize+"%"),parallaxImage=$(this).data("vcParallaxImage"),youtubeId=vcExtractYoutubeId(parallaxImage),youtubeId?insertYoutubeVideoAsBackground($parallaxElement,youtubeId):void 0!==parallaxImage&&$parallaxElement.css("background-image","url("+parallaxImage+")"),skrollrSpeed=skrollrSize-100,skrollrStart=-skrollrSpeed,skrollrEnd=0,$parallaxElement.attr("data-bottom-top","top: "+skrollrStart+"%;").attr("data-top-bottom","top: "+skrollrEnd+"%;")}),!(!callSkrollInit||!window.skrollr)&&(vcSkrollrOptions={forceHeight:!1,smoothScrolling:!1,mobileCheck:function(){return!1}},window.vcParallaxSkroll=skrollr.init(vcSkrollrOptions),window.vcParallaxSkroll)}()}),"function"!=typeof window.vc_gridBehaviour&&(window.vc_gridBehaviour=function(){jQuery.fn.vcGrid&&jQuery("[data-vc-grid]").vcGrid()}),"function"!=typeof window.getColumnsCount&&(window.getColumnsCount=function(el){for(var find=!1,i=1;!1===find;){if(el.hasClass("columns_count_"+i))return find=!0,i;i++}});var screen_size=getSizeName();"function"!=typeof window.wpb_prepare_tab_content&&(window.wpb_prepare_tab_content=function(event,ui){var $ui_panel,$google_maps,panel=ui.panel||ui.newPanel,$pie_charts=panel.find(".vc_pie_chart:not(.vc_ready)"),$round_charts=panel.find(".vc_round-chart"),$line_charts=panel.find(".vc_line-chart"),$carousel=panel.find('[data-ride="vc_carousel"]');if(vc_carouselBehaviour(),vc_plugin_flexslider(panel),ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),panel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&panel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),$pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(),$round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({reload:!1}),$line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({reload:!1}),$carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"),$ui_panel=panel.find(".isotope, .wpb_image_grid_ul"),$google_maps=panel.find(".wpb_gmaps_widget"),0<$ui_panel.length&&$ui_panel.isotope("layout"),$google_maps.length&&!$google_maps.is(".map_ready")){var $frame=$google_maps.find("iframe");$frame.attr("src",$frame.attr("src")),$google_maps.addClass("map_ready")}panel.parents(".isotope").length&&panel.parents(".isotope").each(function(){jQuery(this).isotope("layout")})}),window.vc_googleMapsPointer,jQuery(document).ready(vc_prepareHoverBox),jQuery(window).resize(vc_prepareHoverBox),jQuery(document).ready(function($){window.vc_js()});
function mounthood_sc_init_actions(){
"use strict";
setTimeout(function(){
mounthood_sc_animation();
}, 600);
jQuery('body')
.on('click', '.show_popup_menuitem', function(e){
"use strict";
mounthood_menuitems_show_popup(jQuery(this));
e.preventDefault();
return false;
})
.on('click', '.close_menuitem, .popup_menuitem', function(e){
"use strict";
var target=jQuery(e.target);
if(target.hasClass('popup_menuitem')||target.hasClass('close_menuitem')||target.parent().hasClass('close_menuitem')){
mounthood_menuitems_hide_popup();
e.preventDefault();
return false;
}});
mounthood_sc_init(jQuery('body').eq(0));
}
function mounthood_sc_resize_actions(){
"use strict";
mounthood_sc_sliders_resize();
mounthood_sc_equal_height();
}
function mounthood_sc_scroll_actions(){
"use strict";
mounthood_sc_animation();
}
function mounthood_sc_animation(){
jQuery('[data-animation^="animated"]:not(.animated)').each(function(){
"use strict";
if(jQuery(this).offset().top < jQuery(window).scrollTop() + jQuery(window).height())
jQuery(this).addClass(jQuery(this).data('animation'));
});
}
function mounthood_sc_init(container){
if(window.mounthood_theme_sc_init) mounthood_theme_sc_init(container);
if(container.find('.sc_accordion:not(.inited)').length > 0){
container.find(".sc_accordion:not(.inited)").each(function (){
"use strict";
var init=jQuery(this).data('active');
if(isNaN(init)) init=0;
else init=Math.max(0, init);
jQuery(this)
.addClass('inited')
.accordion({
active: init,
heightStyle: "content",
header: "> .sc_accordion_item > .sc_accordion_title",
create: function (event, ui){
"use strict";
mounthood_sc_init(ui.panel);
if(window.mounthood_init_hidden_elements) mounthood_init_hidden_elements(ui.panel);
ui.header.each(function (){
"use strict";
jQuery(this).parent().addClass('sc_active');
});
},
activate: function (event, ui){
"use strict";
mounthood_sc_init(ui.newPanel);
if(window.mounthood_init_hidden_elements) mounthood_init_hidden_elements(ui.newPanel);
ui.newHeader.each(function (){
"use strict";
jQuery(this).parent().addClass('sc_active');
});
ui.oldHeader.each(function (){
"use strict";
jQuery(this).parent().removeClass('sc_active');
});
}});
});
}
if(container.find('.sc_blogger.layout_polaroid .photostack:not(.inited)').length > 0){
container.find(".sc_blogger.layout_polaroid .photostack:not(.inited)").each(function (){
"use strict";
var obj=jQuery(this);
var id=obj.attr('id');
if(id==undefined){
id='photostack_'+Math.random();
id=id.replace('.', '');
obj.attr('id', id);
}
setTimeout(function(){
"use strict";
obj.addClass('inited').parent().height("auto");
new Photostack(obj.get(0), {
callback: function(item){
}});
}, 10);
});
}
if(container.find('.sc_blogger .sc_scroll_horizontal .sc_scroll_wrapper:not(.inited)').length > 0){
container.find(".sc_blogger .sc_scroll_horizontal .sc_scroll_wrapper:not(.inited)").each(function (){
"use strict";
var obj=jQuery(this);
var width=0;
obj.find('.isotope_item').each(function(){
"use strict";
width +=jQuery(this).outerWidth();
});
obj.addClass('inited').width(width);
});
}
if(container.find('.sc_form form:not(.inited)').length > 0){
container.find(".sc_form form:not(.inited)").each(function(){
"use strict";
jQuery(this).addClass('inited');
jQuery(this).submit(function(e){
"use strict";
mounthood_sc_form_validate(jQuery(this));
e.preventDefault();
return false;
});
if(jQuery(this).find('.js__datepicker').length > 0){
jQuery(this).find('.js__datepicker').pickadate({
onOpen: function(){
"use strict";
jQuery('pre').css('overflow', 'hidden');
},
onClose: function(){
"use strict";
jQuery('pre').css('overflow', '');
},
monthsShort: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec' ],
showMonthsShort: true,
format: 'dd.mm.yyyy',
formatSubmit: 'yyyy-mm-dd',
min: true
});
}
if(jQuery(this).find('.js__timepicker').length > 0){
jQuery(this).find('.js__timepicker').pickatime();
}});
}
if(container.find('.sc_countdown:not(.inited)').length > 0){
container.find('.sc_countdown:not(.inited)')
.each(function (){
"use strict";
jQuery(this).addClass('inited');
var id=jQuery(this).attr('id');
var curDate=new Date();
var curDateTimeStr=curDate.getFullYear()+'-'+(curDate.getMonth()<9 ? '0':'')+(curDate.getMonth()+1)+'-'+(curDate.getDate()<10 ? '0':'')+curDate.getDate()
+' '+(curDate.getHours()<10 ? '0':'')+curDate.getHours()+':'+(curDate.getMinutes()<10 ? '0':'')+curDate.getMinutes()+':'+(curDate.getSeconds()<10 ? '0':'')+curDate.getSeconds();
var interval=1;
var endDateStr=jQuery(this).data('date');
var endDateParts=endDateStr.split('-');
var endTimeStr=jQuery(this).data('time');
var endTimeParts=endTimeStr.split(':');
if(endTimeParts.length < 3) endTimeParts[2]='00';
var endDateTimeStr=endDateStr+' '+endTimeStr;
if(curDateTimeStr < endDateTimeStr){
jQuery(this).find('.sc_countdown_placeholder').countdown({
until: new Date(endDateParts[0], endDateParts[1]-1, endDateParts[2], endTimeParts[0], endTimeParts[1], endTimeParts[2]),
tickInterval: interval,
onTick: mounthood_countdown
});
}else{
jQuery(this).find('.sc_countdown_placeholder').countdown({
since: new Date(endDateParts[0], endDateParts[1]-1, endDateParts[2], endTimeParts[0], endTimeParts[1], endTimeParts[2]),
tickInterval: interval,
onTick: mounthood_countdown
});
}});
}
if(container.find('.sc_googlemap:not(.inited)').length > 0){
container.find('.sc_googlemap:not(.inited)')
.each(function (){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
var map=jQuery(this).addClass('inited');
var map_id=map.attr('id');
var map_zoom=map.data('zoom');
var map_style=map.data('style');
var map_markers=[];
map.find('.sc_googlemap_marker').each(function(){
"use strict";
var marker=jQuery(this);
map_markers.push({
point: marker.data('point'),
address: marker.data('address'),
latlng: marker.data('latlng'),
description: marker.data('description'),
title: marker.data('title')
});
});
mounthood_googlemap_init(jQuery('#'+map_id).get(0), {style: map_style, zoom: map_zoom, markers: map_markers});
});
}
if(container.find('.sc_infobox.sc_infobox_closeable:not(.inited)').length > 0){
container.find('.sc_infobox.sc_infobox_closeable:not(.inited)')
.addClass('inited')
.on('click', function (e){
"use strict";
jQuery(this).slideUp();
e.preventDefault();
return false;
});
}
if(container.find('.sc_intro[data-href]:not(.inited)').length > 0){
container.find('.sc_intro[data-href]:not(.inited)')
.addClass('inited')
.on('click', function (e){
"use strict";
var link=jQuery(this).data('href');
window.location.href=link;
e.preventDefault();
return false;
});
}
if(container.find('.sc_matches:not(.inited)').length > 0){
container.find('.sc_matches:not(.inited)')
.each(function (){
"use strict";
jQuery(this).find('.sc_matches_next .sc_matches_list .sc_match').on('click', function (){
"use strict";
jQuery(this).parents('.sc_matches').find('.sc_matches_current .sc_match').hide();
var item=jQuery(this).data('item');
jQuery(item).fadeIn();
});
});
}
if(container.find('.sc_players_table:not(.inited)').length > 0){
container.find('.sc_players_table:not(.inited)')
.addClass('inited')
.on('click', '.sort', function (e){
"use strict";
var table=jQuery(this).parents('.sc_players_table');
var id=jQuery(table).attr('id')
var sort=jQuery(table).data('sort')=='asc' ? 'desc':'asc';
jQuery.post(MOUNTHOOD_STORAGE['ajax_url'], {
action: 'sort_by_points',
nonce: MOUNTHOOD_STORAGE['ajax_nonce'],
sort: sort,
table: MOUNTHOOD_STORAGE['ajax_' + id]
}).done(function(response){
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: MOUNTHOOD_STORAGE['ajax_error'] };
console.log(response);
}
if(rez.error===''){
table
.data('sort', sort)
.find('.sc_table')
.after(rez.data)
.remove();
mounthood_select_players_category(jQuery(table).find('.sc_players_table_category select'));
}});
e.preventDefault();
return false;
});
}
if(container.find('.sc_players_table_category:not(.inited)').length > 0){
container.find('.sc_players_table_category:not(.inited)')
.addClass('inited')
.on('change', function (){
"use strict";
mounthood_select_players_category(jQuery(this));
});
}
if(container.find('.sc_popup_link:not(.inited)').length > 0){
container.find('.sc_popup_link:not(.inited)').each(function(){
var popup_id=jQuery(this).attr('href');
jQuery(this)
.addClass('inited')
.magnificPopup({
type: 'inline',
removalDelay: 500,
midClick: true,
callbacks: {
beforeOpen: function (){
this.st.mainClass='mfp-zoom-in';
},
open: function(){
"use strict";
mounthood_sc_init(jQuery(popup_id));
mounthood_resize_actions();
if(window.mounthood_init_hidden_elements) mounthood_init_hidden_elements(jQuery(popup_id));
},
close: function(){}}
});
});
}
if(container.find('.sc_recent_news_header_category_item_more:not(.inited)').length > 0){
container.find('.sc_recent_news_header_category_item_more:not(.inited)').each(function(){
"use strict";
jQuery(this)
.addClass('inited')
.on('click', function(e){
"use strict";
jQuery(this).toggleClass('opened').find('.sc_recent_news_header_more_categories').slideToggle();
e.preventDefault();
return false;
});
});
}
if(container.find('.search_wrap:not(.inited)').length > 0){
container.find('.search_wrap:not(.inited)').each(function(){
"use strict";
jQuery(this)
.addClass('inited')
.on('click', '.search_submit', function(e){
"use strict";
var search_wrap=jQuery(this).parents('.search_wrap');
if(!search_wrap.hasClass('search_state_fixed')){
if(search_wrap.hasClass('search_state_opened')){
if(search_wrap.find('.search_field').val()!='')
search_wrap.find('form').get(0).submit();
else
search_wrap.removeClass('search_state_opened').addClass('search_state_closed').find('.search_results').fadeOut();
} else
search_wrap.removeClass('search_state_closed').addClass('search_state_opened').find('.search_field').get(0).focus();
}else{
if(search_wrap.find('.search_field').val()!='')
search_wrap.find('form').get(0).submit();
else {
search_wrap.find('.search_field').val('');
search_wrap.find('.search_results').fadeOut();
}}
e.preventDefault();
return false;
})
.on('click', '.search_close', function(e){
"use strict";
jQuery(this).parents('.search_wrap').removeClass('search_state_opened').addClass('search_state_closed').find('.search_results').fadeOut();
e.preventDefault();
return false;
})
.on('click', '.search_results_close', function(e){
"use strict";
jQuery(this).parent().fadeOut();
e.preventDefault();
return false;
})
.on('click', '.search_more', function(e){
"use strict";
if(jQuery(this).parents('.search_wrap').find('.search_field').val()!='')
jQuery(this).parents('.search_wrap').find('form').get(0).submit();
e.preventDefault();
return false;
})
.on('blur', '.search_field', function(e){
if(jQuery(this).val()==''&&!jQuery(this).parents('.search_wrap').hasClass('search_state_fixed'))
jQuery(this).parents('.search_wrap').removeClass('search_state_opened').addClass('search_state_closed').find('.search_results').fadeOut();
});
if(jQuery(this).hasClass('search_ajax')){
var ajax_timer=null;
jQuery(this).find('.search_field').keyup(function(e){
"use strict";
var search_field=jQuery(this);
var s=search_field.val();
if(ajax_timer){
clearTimeout(ajax_timer);
ajax_timer=null;
}
if(s.length >=MOUNTHOOD_STORAGE['ajax_search_min_length']){
ajax_timer=setTimeout(function(){
"use strict";
jQuery.post(MOUNTHOOD_STORAGE['ajax_url'], {
action: 'ajax_search',
nonce: MOUNTHOOD_STORAGE['ajax_nonce'],
text: s
}).done(function(response){
"use strict";
clearTimeout(ajax_timer);
ajax_timer=null;
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: MOUNTHOOD_STORAGE['ajax_error'] };
console.log(response);
}
if(rez.error===''){
search_field.parents('.search_ajax').find('.search_results_content').empty().append(rez.data);
search_field.parents('.search_ajax').find('.search_results').fadeIn();
}else{
mounthood_message_warning(MOUNTHOOD_STORAGE['strings']['search_error']);
}});
}, MOUNTHOOD_STORAGE['ajax_search_delay']);
}});
}});
}
if(container.find('.sc_pan:not(.inited_pan)').length > 0){
container.find('.sc_pan:not(.inited_pan)')
.each(function (){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
var pan=jQuery(this).addClass('inited_pan');
var cont=pan.parent();
cont.mousemove(function(e){
"use strict";
var anim={};
var tm=0;
var pw=pan.width(), ph=pan.height();
var cw=cont.width(), ch=cont.height();
var coff=cont.offset();
if(pan.hasClass('sc_pan_vertical'))
pan.css('top', -Math.floor((e.pageY - coff.top) / ch * (ph-ch)));
if(pan.hasClass('sc_pan_horizontal'))
pan.css('left', -Math.floor((e.pageX - coff.left) / cw * (pw-cw)));
});
cont.mouseout(function(e){
"use strict";
pan.css({'left': 0, 'top': 0});
});
});
}
if(container.find('.sc_scroll:not(.inited)').length > 0){
container.find('.sc_scroll:not(.inited)')
.each(function (){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
MOUNTHOOD_STORAGE['scroll_init_counter']=0;
mounthood_sc_init_scroll_area(jQuery(this));
});
}
if(container.find('.sc_slider_swiper:not(.inited)').length > 0){
container.find('.sc_slider_swiper:not(.inited)')
.each(function (){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
jQuery(this).addClass('inited');
mounthood_sc_slider_autoheight(jQuery(this));
if(jQuery(this).parents('.sc_slider_pagination_area').length > 0){
jQuery(this).parents('.sc_slider_pagination_area').find('.sc_slider_pagination .post_item').eq(0).addClass('active');
}
var id=jQuery(this).attr('id');
if(id==undefined){
id='swiper_'+Math.random();
id=id.replace('.', '');
jQuery(this).attr('id', id);
}
jQuery(this).addClass(id);
jQuery(this).find('.slides .swiper-slide').css('position', 'relative');
var width=jQuery(this).width();
if(width==0) width=jQuery(this).parent().width();
var spv=jQuery(this).data('slides-per-view');
if(spv==undefined) spv=1;
var min_width=jQuery(this).data('slides-min-width');
if(min_width==undefined) min_width=50;
if(width / spv < min_width) spv=Math.max(1, Math.floor(width / min_width));
var space=jQuery(this).data('slides-space');
if(space==undefined) space=0;
if(MOUNTHOOD_STORAGE['swipers']===undefined) MOUNTHOOD_STORAGE['swipers']={};
MOUNTHOOD_STORAGE['swipers'][id]=new Swiper('.'+id, {
calculateHeight: !jQuery(this).hasClass('sc_slider_height_fixed'),
resizeReInit: true,
autoResize: true,
loop: true,
grabCursor: true,
nextButton: jQuery(this).hasClass('sc_slider_controls') ? '#'+id+' .sc_slider_next':false,
prevButton: jQuery(this).hasClass('sc_slider_controls') ? '#'+id+' .sc_slider_prev':false,
pagination: jQuery(this).hasClass('sc_slider_pagination') ? '#'+id+' .sc_slider_pagination_wrap':false,
paginationClickable: true,
autoplay: jQuery(this).hasClass('sc_slider_noautoplay') ? false:(isNaN(jQuery(this).data('interval')) ? 7000:jQuery(this).data('interval')),
autoplayDisableOnInteraction: false,
initialSlide: 0,
slidesPerView: spv,
loopedSlides: spv,
spaceBetween: space,
speed: 600,
onFirstInit: function (slider){
"use strict";
var cont=jQuery(slider.container);
if(!cont.hasClass('sc_slider_height_auto')) return;
var li=cont.find('.swiper-slide').eq(1);
var h=li.data('height_auto');
if(h > 0){
var pt=parseInt(li.css('paddingTop')), pb=parseInt(li.css('paddingBottom'));
li.height(h);
cont.height(h + (isNaN(pt) ? 0:pt) + (isNaN(pb) ? 0:pb));
cont.find('.swiper-wrapper').height(h + (isNaN(pt) ? 0:pt) + (isNaN(pb) ? 0:pb));
}},
onSlideChangeStart: function (slider){
"use strict";
var cont=jQuery(slider.container);
if(!cont.hasClass('sc_slider_height_auto')) return;
var idx=slider.activeIndex;
var li=cont.find('.swiper-slide').eq(idx);
var h=li.data('height_auto');
if(h > 0){
var pt=parseInt(li.css('paddingTop')), pb=parseInt(li.css('paddingBottom'));
li.height(h);
cont.height(h + (isNaN(pt) ? 0:pt) + (isNaN(pb) ? 0:pb));
cont.find('.swiper-wrapper').height(h + (isNaN(pt) ? 0:pt) + (isNaN(pb) ? 0:pb));
}},
onSlideChangeEnd: function (slider, dir){
"use strict";
var cont=jQuery(slider.container);
if(cont.parents('.sc_slider_pagination_area').length > 0){
var li=cont.parents('.sc_slider_pagination_area').find('.sc_slider_pagination .post_item');
var idx=slider.activeIndex > li.length ? 0:slider.activeIndex-1;
mounthood_sc_change_active_pagination_in_slider(cont, idx);
}}
});
jQuery(this).data('settings', {mode: 'horizontal'});
var curSlide=jQuery(this).find('.slides').data('current-slide');
if(curSlide > 0)
MOUNTHOOD_STORAGE['swipers'][id].slideTo(curSlide-1);
mounthood_sc_prepare_slider_navi(jQuery(this));
});
mounthood_sc_sliders_resize();
}
if(container.find('.sc_skills_item:not(.inited)').length > 0){
mounthood_sc_init_skills(container);
jQuery(window).scroll(function (){ mounthood_sc_init_skills(container); });
}
if(container.find('.sc_skills_arc:not(.inited)').length > 0){
mounthood_sc_init_skills_arc(container);
jQuery(window).scroll(function (){ mounthood_sc_init_skills_arc(container); });
}
if(container.find('.sc_tabs:not(.inited):not(.no_jquery_ui),.tabs_area:not(.inited)').length > 0){
container.find('.sc_tabs:not(.inited):not(.no_jquery_ui),.tabs_area:not(.inited)').each(function (){
"use strict";
var init=jQuery(this).data('active');
if(isNaN(init)) init=0;
else init=Math.max(0, init);
jQuery(this)
.addClass('inited')
.tabs({
active: init,
show: {
effect: 'fadeIn',
duration: 300
},
hide: {
effect: 'fadeOut',
duration: 300
},
create: function (event, ui){
"use strict";
mounthood_sc_init(ui.panel);
if(window.mounthood_init_hidden_elements) mounthood_init_hidden_elements(ui.panel);
mounthood_init_isotope();
},
activate: function (event, ui){
"use strict";
mounthood_sc_init(ui.newPanel);
if(window.mounthood_init_hidden_elements) mounthood_init_hidden_elements(ui.newPanel);
mounthood_init_isotope();
}});
});
}
if(container.find('.sc_tabs.no_jquery_ui:not(.inited)').length > 0){
container.find('.sc_tabs.no_jquery_ui:not(.inited)').each(function (){
"use strict";
jQuery(this)
.addClass('inited')
.on('click', '.sc_tabs_titles li a', function(e){
"use strict";
if(!jQuery(this).parent().hasClass('sc_tabs_active')){
var id_act=jQuery(this).parent().siblings('.sc_tabs_active').find('a').attr('href');
var id=jQuery(this).attr('href');
jQuery(this).parent().addClass('sc_tabs_active').siblings().removeClass('sc_tabs_active');
jQuery(id_act).fadeOut(function(){
"use strict";
jQuery(id).fadeIn(function(){
"use strict";
mounthood_sc_init(jQuery(this));
if(window.mounthood_init_hidden_elements) mounthood_init_hidden_elements(jQuery(this));
});
});
}
e.preventDefault();
return false;
});
jQuery(this).find('.sc_tabs_titles li').eq(0).addClass('sc_tabs_active');
jQuery(this).find('.sc_tabs_content').eq(0).fadeIn(function(){
"use strict";
mounthood_sc_init(jQuery(this));
if(window.mounthood_init_hidden_elements) mounthood_init_hidden_elements(jQuery(this));
});
});
}
if(container.find('.sc_toggles .sc_toggles_title:not(.inited)').length > 0){
container.find('.sc_toggles .sc_toggles_title:not(.inited)')
.addClass('inited')
.on('click', function (){
"use strict";
jQuery(this).toggleClass('ui-state-active').parent().toggleClass('sc_active');
jQuery(this).parent().find('.sc_toggles_content').slideToggle(300, function (){
"use strict";
mounthood_sc_init(jQuery(this).parent().find('.sc_toggles_content'));
if(window.mounthood_init_hidden_elements) mounthood_init_hidden_elements(jQuery(this).parent().find('.sc_toggles_content'));
});
});
}
if(container.find('.sc_zoom:not(.inited)').length > 0){
container.find('.sc_zoom:not(.inited)')
.each(function (){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
jQuery(this).addClass('inited');
jQuery(this).find('img').elevateZoom({
zoomType: "lens",
lensShape: "round",
lensSize: 200,
lensBorderSize: 4,
lensBorderColour: '#ccc'
});
});
}}
function mounthood_sc_init_scroll_area(obj){
"use strict";
if(!mounthood_check_images_complete(obj)&&MOUNTHOOD_STORAGE['scroll_init_counter']++ < 30){
setTimeout(function(){ mounthood_sc_init_scroll_area(obj); }, 200);
return;
}
obj.addClass('inited');
var id=obj.attr('id');
if(id==undefined){
id='scroll_'+Math.random();
id=id.replace('.', '');
obj.attr('id', id);
}
obj.addClass(id);
var parent_obj=obj.parent();
var parent_id=parent_obj.attr('id');
if(parent_id==undefined){
parent_id='scroll_wrap_'+Math.random();
parent_id=parent_id.replace('.', '');
parent_obj.attr('id', parent_id);
}
parent_obj.addClass(parent_id);
var bar=obj.find('#'+id+'_bar');
if(bar.length > 0&&!bar.hasClass(id+'_bar')){
bar.addClass(id+'_bar');
}
if(obj.hasClass('sc_scroll_horizontal')){
obj.find('.sc_scroll_wrapper > .sc_scroll_slide').css('width', 'auto');
obj.find('.sc_scroll_wrapper').css('width', obj.find('.sc_scroll_wrapper > .sc_scroll_slide').width()+10);
obj.find('.sc_scroll_wrapper > .sc_scroll_slide').css('width', '100%')
}
if(MOUNTHOOD_STORAGE['swipers']===undefined) MOUNTHOOD_STORAGE['swipers']={};
MOUNTHOOD_STORAGE['swipers'][id]=new Swiper('.'+id, {
calculateHeight: false,
resizeReInit: true,
autoResize: true,
freeMode: true,
freeModeFluid: true,
grabCursor: true,
mode: obj.hasClass('sc_scroll_vertical') ? 'vertical':'horizontal',
direction: obj.hasClass('sc_scroll_vertical') ? 'vertical':'horizontal',
slidesPerView: obj.hasClass('sc_scroll') ? 'auto':1,
nextButton: parent_obj.hasClass('sc_scroll_controls') ? '#'+parent_id+' .sc_scroll_next':false,
prevButton: parent_obj.hasClass('sc_scroll_controls') ? '#'+parent_id+' .sc_scroll_prev':false,
scrollbar: '.'+id+'_bar',
scrollbarHide: true,
})
obj.data('settings', {mode: 'horizontal'});
}
function mounthood_sc_prepare_slider_navi(slider){
"use strict";
var navi=null;
if(false){
navi=slider.find('> .sc_slider_controls_wrap, > .sc_scroll_controls_wrap');
if(navi.length==0) navi=slider.siblings('.sc_slider_controls_wrap,.sc_scroll_controls_wrap');
if(navi.length > 0){
navi.on('click', '.sc_slider_prev,.sc_scroll_prev', function(e){
var swiper=jQuery(this).parents('.swiper-slider-container');
if(swiper.length==0) swiper=jQuery(this).parents('.sc_slider_controls_wrap,.sc_scroll_controls_wrap').siblings('.swiper-slider-container');
var id=swiper.attr('id');
MOUNTHOOD_STORAGE['swipers'][id].slidePrev();
e.preventDefault();
return false;
})
.on('click', '.sc_slider_next,.sc_scroll_next', function(e){
var swiper=jQuery(this).parents('.swiper-slider-container');
if(swiper.length==0) swiper=jQuery(this).parents('.sc_slider_controls_wrap,.sc_scroll_controls_wrap').siblings('.swiper-slider-container');
var id=swiper.attr('id');
MOUNTHOOD_STORAGE['swipers'][id].slideNext();
e.preventDefault();
return false;
});
}}
navi=slider.siblings('.sc_slider_pagination');
if(navi.length > 0){
navi.on('click', '.post_item', function(e){
var swiper=jQuery(this).parents('.sc_slider_pagination_area').find('.swiper-slider-container');
var id=swiper.attr('id');
MOUNTHOOD_STORAGE['swipers'][id].slideTo(jQuery(this).index()+1);
e.preventDefault();
return false;
});
}}
function mounthood_sc_change_active_pagination_in_slider(slider, idx){
"use strict";
var pg=slider.parents('.sc_slider_pagination_area').find('.sc_slider_pagination');
if(pg.length==0) return;
pg.find('.post_item').removeClass('active').eq(idx).addClass('active');
var h=pg.height();
var off=pg.find('.active').offset().top - pg.offset().top;
var off2=pg.find('.sc_scroll_wrapper').offset().top - pg.offset().top;
var h2=pg.find('.active').height();
if(off < 0){
pg.find('.sc_scroll_wrapper').css({'transform': 'translate3d(0px, 0px, 0px)', 'transition-duration': '0.3s'});
}else if(h <=off+h2){
pg.find('.sc_scroll_wrapper').css({'transform': 'translate3d(0px, -'+(Math.abs(off2)+off-h/4)+'px, 0px)', 'transition-duration': '0.3s'});
}}
function mounthood_sc_slider_autoheight(slider){
"use strict";
if(slider.hasClass('.sc_slider_height_auto')){
slider.find('.swiper-slide').each(function(){
"use strict";
if(jQuery(this).data('height_auto')==undefined){
jQuery(this).attr('data-height_auto', jQuery(this).height());
}});
}}
function mounthood_sc_sliders_resize(){
"use strict";
var slider=arguments[0]!==undefined ? arguments[0]:'.sc_slider_swiper.inited';
var resize=arguments[1]!==undefined ? arguments[1]:true;
jQuery(slider).each(function(){
"use strict";
var id=jQuery(this).attr('id');
var width=jQuery(this).width();
var last_width=jQuery(this).data('last-width');
if(isNaN(last_width)) last_width=0;
if(last_width==0||last_width!=width){
var spv=jQuery(this).data('slides-per-view');
if(spv==undefined) spv=1;
var min_width=jQuery(this).data('slides-min-width');
if(min_width==undefined) min_width=50;
if(width / spv < min_width) spv=Math.max(1, Math.floor(width / min_width));
jQuery(this).data('last-width', width);
if(MOUNTHOOD_STORAGE['swipers'][id].params.slidesPerView!=spv){
MOUNTHOOD_STORAGE['swipers'][id].params.slidesPerView=spv;
MOUNTHOOD_STORAGE['swipers'][id].params.loopedSlides=spv;
}
MOUNTHOOD_STORAGE['swipers'][id].onResize();
}
if(resize&&!jQuery(this).hasClass('sc_slider_height_fixed')){
var h=0;
if(jQuery(this).find('.swiper-slide > img').length > 0){
jQuery(this).find('.swiper-slide > img').each(function(){
"use strict";
if(jQuery(this).height() > h) h=jQuery(this).height();
});
jQuery(this).height(h);
}else if(jQuery(this).find('.swiper-slide').css('backgroundImage')!='none'){
h=Math.floor(width/16*9);
jQuery(this).height(h).find('.swiper-slide').height(h);
}}
});
jQuery('.sc_slider_pagination_area').each(function(){
"use strict";
var h=jQuery(this).find('.sc_slider').height();
if(h){
jQuery(this).height(h);
jQuery(this).find('.sc_slider_pagination').height(h);
jQuery(this).find('.sc_slider_pagination .sc_scroll_vertical').height(h);
}});
}
function mounthood_sc_equal_height(){
"use strict";
jQuery('[data-equal-height]').each(function(){
"use strict";
var eh_wrap=jQuery(this);
var eh_items_selector=eh_wrap.data('equal-height');
if(eh_items_selector){
var max_h=0;
var items=[];
var row_y=0;
var i=0;
eh_wrap.find(eh_items_selector).each(function(){
"use strict";
var el=jQuery(this);
el.height('auto');
var el_height=el.height();
var el_offset=el.offset().top;
if(row_y==0) row_y=el_offset;
if(row_y < el_offset){
if(items.length > 0){
if(max_h > 0){
for (i=0; i max_h) max_h=el_height;
items.push(el);
});
if(items.length > 0&&max_h > 0){
for (i=0; i scrollSkills){
skillsItem.addClass('inited');
var skills=skillsItem.parents('.sc_skills').eq(0);
var type=skills.data('type');
var total=(type=='pie'&&skills.hasClass('sc_skills_compact_on')) ? skillsItem.find('.sc_skills_data .pie'):skillsItem.find('.sc_skills_total').eq(0);
var start=parseInt(total.data('start'));
var stop=parseInt(total.data('stop'));
var maximum=parseInt(total.data('max'));
var startPercent=Math.round(start/maximum*100);
var stopPercent=Math.round(stop/maximum*100);
var ed=total.data('ed');
var duration=parseInt(total.data('duration'));
var speed=parseInt(total.data('speed'));
var step=parseInt(total.data('step'));
if(type=='bar'){
var dir=skills.data('dir');
var count=skillsItem.find('.sc_skills_count').eq(0);
if(dir=='horizontal')
count.css('width', startPercent + '%').animate({ width: stopPercent + '%' }, duration);
else if(dir=='vertical')
count.css('height', startPercent + '%').animate({ height: stopPercent + '%' }, duration);
mounthood_sc_animate_skills_counter(start, stop, speed-(dir!='unknown' ? 5:0), step, ed, total);
}else if(type=='counter'){
mounthood_sc_animate_skills_counter(start, stop, speed - 5, step, ed, total);
}else if(type=='pie'){
var steps=parseInt(total.data('steps'));
var bg_color=total.data('bg_color');
var border_color=total.data('border_color');
var cutout=parseInt(total.data('cutout'));
var easing=total.data('easing');
var options={
segmentShowStroke: true,
segmentStrokeColor: border_color,
segmentStrokeWidth: 1,
percentageInnerCutout:cutout,
animationSteps: steps,
animationEasing: easing,
animateRotate: true,
animateScale: false,
};
var pieData=[];
total.each(function(){
"use strict";
var color=jQuery(this).data('color');
var stop=parseInt(jQuery(this).data('stop'));
var stopPercent=Math.round(stop/maximum*100);
pieData.push({
value: stopPercent,
color: color
});
});
if(total.length==1){
mounthood_sc_animate_skills_counter(start, stop, Math.round(1500/steps), step, ed, total);
pieData.push({
value: 100-stopPercent,
color: bg_color
});
}
var canvas=skillsItem.find('canvas');
canvas.attr({width: skillsItem.width(), height: skillsItem.width()}).css({width: skillsItem.width(), height: skillsItem.height()});
new Chart(canvas.get(0).getContext("2d")).Doughnut(pieData, options);
}}
});
}
function mounthood_sc_animate_skills_counter(start, stop, speed, step, ed, total){
"use strict";
start=Math.min(stop, start + step);
total.text(start+ed);
if(start < stop){
setTimeout(function (){
mounthood_sc_animate_skills_counter(start, stop, speed, step, ed, total);
}, speed);
}}
function mounthood_sc_init_skills_arc(container){
"use strict";
if(arguments.length==0) var container=jQuery('body');
container.find('.sc_skills_arc:not(.inited)').each(function (){
var arc=jQuery(this);
arc.addClass('inited');
var items=arc.find('.sc_skills_data .arc');
var canvas=arc.find('.sc_skills_arc_canvas').eq(0);
var legend=arc.find('.sc_skills_legend').eq(0);
var w=Math.round(arc.width() - legend.width());
var c=Math.floor(w/2);
var o={
random: function(l, u){
"use strict";
return Math.floor((Math.random()*(u-l+1))+l);
},
diagram: function(){
"use strict";
var r=Raphael(canvas.attr('id'), w, w),
hover=Math.round(w/2/items.length),
rad=hover,
step=Math.round(((w-20)/2-rad)/items.length),
stroke=Math.round(w/9/items.length),
speed=400;
r.circle(c, c, Math.round(w/2)).attr({ stroke: 'none', fill: MOUNTHOOD_STORAGE['theme_bg_color'] ? MOUNTHOOD_STORAGE['theme_bg_color']:'#ffffff' });
var title=r.text(c, c, arc.data('caption')).attr({
font: Math.round(rad*0.75)+'px "'+MOUNTHOOD_STORAGE['theme_font']+'"',
fill: MOUNTHOOD_STORAGE['theme_color'] ? MOUNTHOOD_STORAGE['theme_color']:'#909090'
}).toFront();
rad -=Math.round(step/2);
r.customAttributes.arc=function(value, color, rad){
"use strict";
var v=3.6 * value,
alpha=v==360 ? 359.99:v,
rand=o.random(91, 240),
a=(rand-alpha) * Math.PI/180,
b=rand * Math.PI/180,
sx=c + rad * Math.cos(b),
sy=c - rad * Math.sin(b),
x=c + rad * Math.cos(a),
y=c - rad * Math.sin(a),
path=[['M', sx, sy], ['A', rad, rad, 0, +(alpha > 180), 1, x, y]];
return { path: path, stroke: color }}
items.each(function(i){
"use strict";
var t=jQuery(this),
color=t.find('.color').val(),
value=t.find('.percent').val(),
text=t.find('.text').text();
rad +=step;
var z=r.path().attr({ arc: [value, color, rad], 'stroke-width': stroke });
z.mouseover(function(){
"use strict";
this.animate({ 'stroke-width': hover, opacity: .75 }, 1000, 'elastic');
if(Raphael.type!='VML')
this.toFront();
title.stop().animate({ opacity: 0 }, speed, '>', function(){
this.attr({ text: (text ? text + '\n':'') + value + '%' }).animate({ opacity: 1 }, speed, '<');
});
}).mouseout(function(){
"use strict";
this.stop().animate({ 'stroke-width': stroke, opacity: 1 }, speed*4, 'elastic');
title.stop().animate({ opacity: 0 }, speed, '>', function(){
title.attr({ text: arc.data('caption') }).animate({ opacity: 1 }, speed, '<');
});
});
});
}}
o.diagram();
});
}
function mounthood_countdown(dt){
"use strict";
var counter=jQuery(this).parent();
for (var i=3; i=0; ch--){
counter.find('.sc_countdown_item').eq(i-3).find('.sc_countdown_digits span').eq(ch+(i==3&&v.length<3 ? 1:0)).removeClass('hide').text(v.substr(ch, 1));
}}
}
function mounthood_sc_form_validate(form){
"use strict";
var url=form.attr('action');
if(url=='') return false;
form.find('input').removeClass('error_fields_class');
var error=false;
var form_custom=form.data('formtype')=='form_custom';
if(!form_custom){
var rules=[], rule={};
if(form.find('[name="username"]').length > 0){
rule={
field: "username",
max_length: { value: 60, message: MOUNTHOOD_STORAGE['strings']['name_long'] }};
if(form.find('[name="username"][aria-required="true"]').length > 0)
rule['min_length']={ value: 1, message: MOUNTHOOD_STORAGE['strings']['name_empty'] };
rules.push(rule);
}
if(form.find('[name="email"]').length > 0){
rule={
field: "email",
max_length: { value: 60, message: MOUNTHOOD_STORAGE['strings']['email_long'] },
mask: { value: MOUNTHOOD_STORAGE['email_mask'], message: MOUNTHOOD_STORAGE['strings']['email_not_valid'] }};
if(form.find('[name="email"][aria-required="true"]').length > 0)
rule['min_length']={ value: 7, message: MOUNTHOOD_STORAGE['strings']['email_empty'] };
rules.push(rule);
}
if(form.find('[name="subject"]').length > 0){
rule={
field: "subject",
max_length: { value: 100, message: MOUNTHOOD_STORAGE['strings']['subject_long'] }};
if(form.find('[name="subject"][aria-required="true"]').length > 0)
rule['min_length']={ value: 1, message: MOUNTHOOD_STORAGE['strings']['subject_empty'] };
rules.push(rule);
}
if(form.find('[name="message"]').length > 0){
rule={
field: "message",
max_length: { value: MOUNTHOOD_STORAGE['contacts_maxlength'], message: MOUNTHOOD_STORAGE['strings']['text_long'] }};
if(form.find('[name="message"][aria-required="true"]').length > 0)
rule['min_length']={ value: 1, message: MOUNTHOOD_STORAGE['strings']['text_empty'] };
rules.push(rule);
}
error=mounthood_form_validate(form, {
error_message_show: true,
error_message_time: 4000,
error_message_class: "sc_infobox sc_infobox_style_error",
error_fields_class: "error_fields_class",
exit_after_first_error: false,
rules: rules
});
}
if(!error&&url!='#'){
jQuery.post(url, {
action: "send_form",
nonce: MOUNTHOOD_STORAGE['ajax_nonce'],
type: form.data('formtype'),
data: form.serialize()
}).done(function(response){
"use strict";
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: MOUNTHOOD_STORAGE['ajax_error'] };
console.log(response);
}
var result=form.find(".result").toggleClass("sc_infobox_style_error", false).toggleClass("sc_infobox_style_success", false);
if(rez.error===''){
form.get(0).reset();
result.addClass("sc_infobox_style_success").html(MOUNTHOOD_STORAGE['strings']['send_complete']);
var return_url=form.find('input[name="return_url"]');
if(return_url.length > 0&&return_url.val()!=''){
setTimeout(function(){
"use strict";
window.location.href=return_url.val();
}, 3300);
}}else{
result.addClass("sc_infobox_style_error").html(MOUNTHOOD_STORAGE['strings']['send_error'] + ' ' + rez.error);
}
result.fadeIn().delay(3000).fadeOut();
});
}
return !error;
}
function mounthood_select_players_category(sel){
var value=sel.find(':selected').data('cat');
var table=sel.parents('.sc_players_table');
if(value=='all')
jQuery(table).find('.sc_table tr:nth-child(n+2)').show();
else {
jQuery(table).find('.sc_table tr:nth-child(n+2)').hide();
jQuery(table).find('.sc_table tr').each(function(){
var cat=jQuery(this).data('cat');
if(cat!=null&&cat.indexOf(value)!=-1)
jQuery(this).show();
});
}}
function mounthood_menuitems_show_popup(obj){
"use strict";
if(typeof MOUNTHOOD_STORAGE['menuitem_load']=='undefined'){
MOUNTHOOD_STORAGE['menuitem_load']=false;
MOUNTHOOD_STORAGE['menuitems_list']=[];
}else if(MOUNTHOOD_STORAGE['menuitem_load']){
return;
}
jQuery('#page_preloader').data('bg-color', jQuery('#page_preloader').css('background-color')).css({display: 'block', opacity: 0, backgroundColor: 'transparent'}).animate({opacity:0.8}, 300);
if(MOUNTHOOD_STORAGE['menuitems_list'].length==0){
var menuitems_list_id=obj.parents('.sc_menuitems').attr("id");
MOUNTHOOD_STORAGE['menuitems_list']=MOUNTHOOD_STORAGE['menuitems'][menuitems_list_id].split(",");
}
var menuitem_id=obj.attr('rel');
MOUNTHOOD_STORAGE['menuitem_load']=true;
jQuery.post(MOUNTHOOD_STORAGE['ajax_url'], {
action: 'ajax_menuitem',
nonce: MOUNTHOOD_STORAGE['ajax_nonce'],
text: menuitem_id
}).done(function(response){
"use strict";
MOUNTHOOD_STORAGE['menuitem_load']=false;
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: MOUNTHOOD_STORAGE['ajax_error'] + '
' + response };}
jQuery('#page_preloader').animate({opacity:0}, 500, function(){ jQuery(this).css({display: 'none', backgroundColor: jQuery(this).data('bg-color')});});
if(rez.error===''){
var delay=0;
if(jQuery('.popup_menuitem').length==0){
jQuery('body').append('');
jQuery('#overlay').fadeIn(500);
}else{
delay=500;
jQuery('.popup_menuitem').fadeOut(delay);
}
setTimeout(function(){
jQuery('.popup_menuitem').html(rez.data);
jQuery('.popup_menuitem .sc_menuitems_wrap').append("");
if(MOUNTHOOD_STORAGE['menuitems_list'].length > 1){
var idx=0;
for (var i=0; i